Revert again, this time without post-commit reindent hooks to put back the indentation :-)

Original commit message from CVS:
Revert again, this time without post-commit reindent hooks
to put back the indentation :-)
This commit is contained in:
Johan Dahlin 2004-03-15 14:43:35 +00:00
parent 2143a02a13
commit ecd88e381d
134 changed files with 4206 additions and 3970 deletions

View file

@ -174,6 +174,12 @@ pipeline</ulink> and Microsoft's DirectShow for some background.
@use_threads:
<!-- ##### VARIABLE g_log_domain_gstreamer ##### -->
<para>
The variable that holds the GStreamer log domain
</para>
<!-- ##### MACRO GST_VERSION_MAJOR ##### -->
<para>
The major version of GStreamer at compile time

View file

@ -72,34 +72,6 @@ The GstBin object
</para>
<!-- ##### SIGNAL GstBin::element-added ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was added to the bin
<!-- ##### SIGNAL GstBin::element-removed ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was removed from the bin
<!-- ##### SIGNAL GstBin::iterate ##### -->
<para>
This signal is emitted when a bin iterates, either automatically or
due to a #gst_bin_iterate() call. The return value is used to
determine if the object method handler processed any data.
In most normal cases, a user-provided signal handler should return
FALSE.
</para>
@gstbin: the object which received the signal.
@Returns: TRUE if the state of the bin was advanced.
<!-- ##### USER_FUNCTION GstBinPrePostIterateFunction ##### -->
<para>
The signature of the callback for the post and pre iterate function as set with
@ -252,3 +224,31 @@ gst_bin_set_pre_iterate_function() and gst_bin_set_post_iterate_function().
@clock:
<!-- ##### SIGNAL GstBin::element-added ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was added to the bin
<!-- ##### SIGNAL GstBin::element-removed ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was removed from the bin
<!-- ##### SIGNAL GstBin::iterate ##### -->
<para>
This signal is emitted when a bin iterates, either automatically or
due to a #gst_bin_iterate() call. The return value is used to
determine if the object method handler processed any data.
In most normal cases, a user-provided signal handler should return
FALSE.
</para>
@gstbin: the object which received the signal.
@Returns: TRUE if the state of the bin was advanced.

View file

@ -235,21 +235,6 @@ Get the clock flags
</para>
<!-- ##### ARG GstClock:event-diff ##### -->
<para>
</para>
<!-- ##### ARG GstClock:max-diff ##### -->
<para>
Maximum allowed diff for clock sync requests against the real time.
</para>
<!-- ##### ARG GstClock:stats ##### -->
<para>
Boolean property to activate stat generation on the clock.
</para>
<!-- ##### FUNCTION gst_clock_set_speed ##### -->
<para>
@ -417,3 +402,18 @@ Boolean property to activate stat generation on the clock.
@id:
<!-- ##### ARG GstClock:event-diff ##### -->
<para>
</para>
<!-- ##### ARG GstClock:max-diff ##### -->
<para>
Maximum allowed diff for clock sync requests against the real time.
</para>
<!-- ##### ARG GstClock:stats ##### -->
<para>
Boolean property to activate stat generation on the clock.
</para>

View file

@ -20,6 +20,16 @@ You'll get a bitmask of flags with gst_cpu_get_flags().
</para>
<!-- ##### ENUM GstCPUFlags ##### -->
<para>
Flags that represent cpu capabilities
</para>
@GST_CPU_FLAG_MMX: The cpu is mmx enabled
@GST_CPU_FLAG_SSE: The cpu is sse enabled
@GST_CPU_FLAG_MMXEXT: The cpu has extended mmx instructions
@GST_CPU_FLAG_3DNOW: The cpu is 3DNOW enabled
<!-- ##### FUNCTION gst_cpu_get_flags ##### -->
<para>
Request a set of bits specifiying the features of the CPU.

View file

@ -71,59 +71,6 @@ The element object
</para>
<!-- ##### SIGNAL GstElement::eos ##### -->
<para>
Signal emited when the element goes to PAUSED due to an end-of-stream
condition.
</para>
@gstelement: the object which received the signal.
<!-- ##### SIGNAL GstElement::error ##### -->
<para>
This signal is emitted when an element has encountered an error that caused
it to fail performing its function.
</para>
@gstelement: the object which received the signal.
@arg1: the original #GstElement that generated the error.
@arg2: a #GError containing the translated error message.
@arg3: a debug string providing additional untranslated debug information, or NULL.
<!-- ##### SIGNAL GstElement::found-tag ##### -->
<para>
</para>
@gstelement: the object which received the signal.
@arg1:
@arg2:
<!-- ##### SIGNAL GstElement::new-pad ##### -->
<para>
Is triggered whenever a new pad is added to an element.
</para>
@gstelement: the object which received the signal.
@arg1: the new pad that was added
<!-- ##### SIGNAL GstElement::pad-removed ##### -->
<para>
Is triggered whenever a pad has been removed from the element.
</para>
@gstelement: the object which received the signal.
@arg1: The pad that was removed.
<!-- ##### SIGNAL GstElement::state-change ##### -->
<para>
Is triggered whenever the state of an element changes.
</para>
@gstelement: the object which received the signal.
@arg1: the new state of the object
@arg2:
<!-- ##### MACRO gst_element_get_name ##### -->
<para>
Gets the name of the element.
@ -1019,3 +966,56 @@ Helper macro to create query type functions
@...: list of query types.
<!-- ##### SIGNAL GstElement::eos ##### -->
<para>
Signal emited when the element goes to PAUSED due to an end-of-stream
condition.
</para>
@gstelement: the object which received the signal.
<!-- ##### SIGNAL GstElement::error ##### -->
<para>
This signal is emitted when an element has encountered an error that caused
it to fail performing its function.
</para>
@gstelement: the object which received the signal.
@arg1: the original #GstElement that generated the error.
@arg2: a #GError containing the translated error message.
@arg3: a debug string providing additional untranslated debug information, or NULL.
<!-- ##### SIGNAL GstElement::found-tag ##### -->
<para>
</para>
@gstelement: the object which received the signal.
@arg1:
@arg2:
<!-- ##### SIGNAL GstElement::new-pad ##### -->
<para>
Is triggered whenever a new pad is added to an element.
</para>
@gstelement: the object which received the signal.
@arg1: the new pad that was added
<!-- ##### SIGNAL GstElement::pad-removed ##### -->
<para>
Is triggered whenever a pad has been removed from the element.
</para>
@gstelement: the object which received the signal.
@arg1: The pad that was removed.
<!-- ##### SIGNAL GstElement::state-change ##### -->
<para>
Is triggered whenever the state of an element changes.
</para>
@gstelement: the object which received the signal.
@arg1: the new state of the object
@arg2:

View file

@ -15,6 +15,18 @@ formats can be used to perform seeking or conversions/query operations.
#GstPad, #GstElement
</para>
<!-- ##### ENUM GstFormat ##### -->
<para>
Standard predefined formats
</para>
@GST_FORMAT_UNDEFINED: undefined format
@GST_FORMAT_DEFAULT: the default format of the pad/element
@GST_FORMAT_BYTES: bytes
@GST_FORMAT_TIME: time in nanoseconds
@GST_FORMAT_BUFFERS: buffers
@GST_FORMAT_PERCENT: percentage of stream
<!-- ##### MACRO GST_FORMAT_PERCENT_MAX ##### -->
<para>
The PERCENT format is between 0 and this value

View file

@ -209,19 +209,6 @@ The GstIndex object
</para>
<!-- ##### SIGNAL GstIndex::entry-added ##### -->
<para>
Is emited when a new entry is added to the index.
</para>
@gstindex: the object which received the signal.
@arg1: The entry added to the index.
<!-- ##### ARG GstIndex:resolver ##### -->
<para>
</para>
<!-- ##### FUNCTION gst_index_new ##### -->
<para>
@ -414,3 +401,16 @@ Is emited when a new entry is added to the index.
@id:
<!-- ##### SIGNAL GstIndex::entry-added ##### -->
<para>
Is emited when a new entry is added to the index.
</para>
@gstindex: the object which received the signal.
@arg1: The entry added to the index.
<!-- ##### ARG GstIndex:resolver ##### -->
<para>
</para>

View file

@ -21,6 +21,12 @@ The GstMemChunk is used to allocate critical resources for #GstBuffer and
#GstAtomic, #GstBuffer, #GstEvent, #GstData
</para>
<!-- ##### STRUCT GstMemChunk ##### -->
<para>
The memchunk structure
</para>
<!-- ##### FUNCTION gst_mem_chunk_new ##### -->
<para>

View file

@ -40,47 +40,6 @@ The GstObject
</para>
<!-- ##### SIGNAL GstObject::deep-notify ##### -->
<para>
The deep notify signal is used to be notified of property changes.
it is typically attached to the toplevel bin to receive notifications
from all the elements contained in that bin.
</para>
@gstobject: the object which received the signal.
@arg1: the object that originated the signal
@arg2: the property that changed
<!-- ##### SIGNAL GstObject::object-saved ##### -->
<para>
Is trigered whenever a new object is saved to XML. You can connect to
this signal to insert custom XML tags into the core XML.
</para>
@gstobject: the object which received the signal.
@arg1: the xmlNodePtr of the parent node
<!-- ##### SIGNAL GstObject::parent-set ##### -->
<para>
Is emitted when the parent of an object is set.
</para>
@gstobject: the object which received the signal.
@arg1: the new parent
<!-- ##### SIGNAL GstObject::parent-unset ##### -->
<para>
Is emitted when the parent of an object is unset.
</para>
@gstobject: the object which received the signal.
@arg1: the old parent
<!-- ##### ARG GstObject:name ##### -->
<para>
The name of the object
</para>
<!-- ##### MACRO GST_FLAGS ##### -->
<para>
This macro returns the entire set of flags for the object.
@ -331,3 +290,44 @@ Check if the object has been destroyed.
@Returns:
<!-- ##### SIGNAL GstObject::deep-notify ##### -->
<para>
The deep notify signal is used to be notified of property changes.
it is typically attached to the toplevel bin to receive notifications
from all the elements contained in that bin.
</para>
@gstobject: the object which received the signal.
@arg1: the object that originated the signal
@arg2: the property that changed
<!-- ##### SIGNAL GstObject::object-saved ##### -->
<para>
Is trigered whenever a new object is saved to XML. You can connect to
this signal to insert custom XML tags into the core XML.
</para>
@gstobject: the object which received the signal.
@arg1: the xmlNodePtr of the parent node
<!-- ##### SIGNAL GstObject::parent-set ##### -->
<para>
Is emitted when the parent of an object is set.
</para>
@gstobject: the object which received the signal.
@arg1: the new parent
<!-- ##### SIGNAL GstObject::parent-unset ##### -->
<para>
Is emitted when the parent of an object is unset.
</para>
@gstobject: the object which received the signal.
@arg1: the old parent
<!-- ##### ARG GstObject:name ##### -->
<para>
The name of the object
</para>

View file

@ -1193,11 +1193,6 @@ The Ghostpad object
</para>
<!-- ##### ARG GstGhostPad:real-pad ##### -->
<para>
</para>
<!-- ##### FUNCTION gst_ghost_pad_new ##### -->
<para>

View file

@ -86,15 +86,6 @@ The padtemplate object.
</para>
<!-- ##### SIGNAL GstPadTemplate::pad-created ##### -->
<para>
This signal is fired when an element creates a pad from this
template.
</para>
@gstpadtemplate: the object which received the signal.
@arg1: The pad that was created.
<!-- ##### ENUM GstPadTemplateFlags ##### -->
<para>
Flags for the padtemplate
@ -176,3 +167,12 @@ Check if the properties of the padtemplate are fixed
@Returns:
<!-- ##### SIGNAL GstPadTemplate::pad-created ##### -->
<para>
This signal is fired when an element creates a pad from this
template.
</para>
@gstpadtemplate: the object which received the signal.
@arg1: The pad that was created.

View file

@ -41,6 +41,14 @@ The error quark
<!-- ##### FUNCTION gst_plugin_error_quark ##### -->
<para>
Get the error quark
</para>
@Returns: The error quark used in GError messages
<!-- ##### ENUM GstPluginError ##### -->
<para>
The plugin loading errors

View file

@ -15,6 +15,20 @@ Query types can be used to perform queries on pads and elements.
#GstPad, #GstElement
</para>
<!-- ##### ENUM GstQueryType ##### -->
<para>
Standard predefined Query types
</para>
@GST_QUERY_NONE: invalid query type
@GST_QUERY_TOTAL: total length of stream
@GST_QUERY_POSITION: current position in stream
@GST_QUERY_LATENCY: latency of stream
@GST_QUERY_JITTER: current jitter of stream
@GST_QUERY_START: start of configured segment
@GST_QUERY_SEGMENT_END: end of configured segment
@GST_QUERY_RATE: current rate of the stream
<!-- ##### MACRO GST_QUERY_TYPE_RATE_DEN ##### -->
<para>
Rates are relative to this value
@ -75,10 +89,10 @@ Convenience function to define a function that returns an array of query types.
</para>
@Param1:
@type:
@Returns:
<!-- # Unused Parameters # -->
@type:
@Param1:
<!-- ##### FUNCTION gst_query_type_get_definitions ##### -->

View file

@ -4556,16 +4556,6 @@ can perform necessary cleanup.
@pool: The pool that is being destroyed
@user_data: user data as set on th bufferpool
<!-- ##### ENUM GstCPUFlags ##### -->
<para>
Flags that represent cpu capabilities
</para>
@GST_CPU_FLAG_MMX: The cpu is mmx enabled
@GST_CPU_FLAG_SSE: The cpu is sse enabled
@GST_CPU_FLAG_MMXEXT: The cpu has extended mmx instructions
@GST_CPU_FLAG_3DNOW: The cpu is 3DNOW enabled
<!-- ##### STRUCT GstCacheAssociation ##### -->
<para>
@ -5168,17 +5158,11 @@ Indicates the mmapped area should be touched to bring it into memory.
</para>
<!-- ##### ENUM GstFormat ##### -->
<!-- ##### ARG GstGhostPad:real-pad ##### -->
<para>
Standard predefined formats
</para>
@GST_FORMAT_UNDEFINED: undefined format
@GST_FORMAT_DEFAULT: the default format of the pad/element
@GST_FORMAT_BYTES: bytes
@GST_FORMAT_TIME: time in nanoseconds
@GST_FORMAT_BUFFERS: buffers
@GST_FORMAT_PERCENT: percentage of stream
<!-- ##### STRUCT GstHttpSrc ##### -->
<para>
@ -5297,12 +5281,6 @@ Specify the location of the file. The location must be a fully qualified URL.
</para>
<!-- ##### STRUCT GstMemChunk ##### -->
<para>
The memchunk structure
</para>
<!-- ##### STRUCT GstMemChunkElement ##### -->
<para>
An entry in the memchunk area
@ -5533,20 +5511,6 @@ Sets the command to be executed.
</para>
<!-- ##### ENUM GstQueryType ##### -->
<para>
Standard predefined Query types
</para>
@GST_QUERY_NONE: invalid query type
@GST_QUERY_TOTAL: total length of stream
@GST_QUERY_POSITION: current position in stream
@GST_QUERY_LATENCY: latency of stream
@GST_QUERY_JITTER: current jitter of stream
@GST_QUERY_START: start of configured segment
@GST_QUERY_SEGMENT_END: end of configured segment
@GST_QUERY_RATE: current rate of the stream
<!-- ##### STRUCT GstQueue ##### -->
<para>
@ -5613,17 +5577,6 @@ the region types for #gst_pad_pullregion.
@global_reg:
@local_reg:
<!-- ##### ENUM GstRegistryReturn ##### -->
<para>
The return value of registry operations
</para>
@GST_REGISTRY_OK: The registry reported no error.
@GST_REGISTRY_LOAD_ERROR: There was a load error
@GST_REGISTRY_SAVE_ERROR: There was an error saving the registry
@GST_REGISTRY_PLUGIN_LOAD_ERROR: There was an error loading a plugin
@GST_REGISTRY_PLUGIN_SIGNATURE_ERROR: There was an error saving a plugin
<!-- ##### STRUCT GstRegistryWrite ##### -->
<para>
@ -5851,20 +5804,6 @@ Flags for the GstSrc element
</para>
<!-- ##### ENUM GstTagMergeMode ##### -->
<para>
</para>
@GST_TAG_MERGE_UNDEFINED:
@GST_TAG_MERGE_REPLACE_ALL:
@GST_TAG_MERGE_REPLACE:
@GST_TAG_MERGE_APPEND:
@GST_TAG_MERGE_PREPEND:
@GST_TAG_MERGE_KEEP:
@GST_TAG_MERGE_KEEP_ALL:
@GST_TAG_MERGE_COUNT:
<!-- ##### STRUCT GstTee ##### -->
<para>
@ -5988,15 +5927,6 @@ Query the element for the current mime type
</para>
<!-- ##### SIGNAL GstXML::object-loaded ##### -->
<para>
</para>
@gstxml: the object which received the signal.
@arg1:
@arg2:
<!-- ##### USER_FUNCTION GstXMLRegistryAddPathList ##### -->
<para>
@ -6752,12 +6682,6 @@ must be defined to activate the tracing functionality.
@llink:
@Returns:
<!-- ##### VARIABLE g_log_domain_gstreamer ##### -->
<para>
The variable that holds the GStreamer log domain
</para>
<!-- ##### MACRO g_object_class_find_property ##### -->
<para>
@ -9643,13 +9567,6 @@ Destroys the pipeline.
@Returns:
<!-- ##### FUNCTION gst_plugin_error_quark ##### -->
<para>
Get the error quark
</para>
@Returns: The error quark used in GError messages
<!-- ##### FUNCTION gst_plugin_feature_get_type ##### -->
<para>

View file

@ -14,6 +14,17 @@ The registry holds the available plugins in the system.
#GstPlugin, #GstPluginFeature
</para>
<!-- ##### ENUM GstRegistryReturn ##### -->
<para>
The return value of registry operations
</para>
@GST_REGISTRY_OK: The registry reported no error.
@GST_REGISTRY_LOAD_ERROR: There was a load error
@GST_REGISTRY_SAVE_ERROR: There was an error saving the registry
@GST_REGISTRY_PLUGIN_LOAD_ERROR: There was an error loading a plugin
@GST_REGISTRY_PLUGIN_SIGNATURE_ERROR: There was an error saving a plugin
<!-- ##### ENUM GstRegistryFlags ##### -->
<para>
Flags for the registry

View file

@ -14,6 +14,20 @@ GstTag
</para>
<!-- ##### ENUM GstTagMergeMode ##### -->
<para>
</para>
@GST_TAG_MERGE_UNDEFINED:
@GST_TAG_MERGE_REPLACE_ALL:
@GST_TAG_MERGE_REPLACE:
@GST_TAG_MERGE_APPEND:
@GST_TAG_MERGE_PREPEND:
@GST_TAG_MERGE_KEEP:
@GST_TAG_MERGE_KEEP_ALL:
@GST_TAG_MERGE_COUNT:
<!-- ##### ENUM GstTagFlag ##### -->
<para>

View file

@ -34,6 +34,15 @@ The GstThread object
</para>
<!-- ##### FUNCTION gst_thread_new ##### -->
<para>
</para>
@name:
@Returns:
<!-- ##### SIGNAL GstThread::shutdown ##### -->
<para>
@ -46,12 +55,3 @@ The GstThread object
The thread priority
</para>
<!-- ##### FUNCTION gst_thread_new ##### -->
<para>
</para>
@name:
@Returns:

View file

@ -105,3 +105,21 @@ All GstElements can be serialized to an XML presentation and subsequently loaded
@Returns:
<!-- ##### SIGNAL GstXML::object-loaded ##### -->
<para>
</para>
@gstxml: the object which received the signal.
@arg1:
@arg2:
<!-- ##### SIGNAL GstXML::object-loaded ##### -->
<para>
</para>
@:
@:
@:

View file

@ -11,5 +11,4 @@ typedef struct
char *location;
int channel_id;
}
output_channel_t;
} output_channel_t;

View file

@ -9,5 +9,4 @@ typedef struct
char *location;
int channel_id;
}
input_channel_t;
} input_channel_t;

View file

@ -24,6 +24,7 @@
#include <gst/gst.h>
G_BEGIN_DECLS
/* This is the definition of the element's object structure. */
typedef struct _GstExample GstExample;
@ -32,12 +33,11 @@ typedef struct _GstExample GstExample;
* the beginning of the object. This allows the element to be cast to
* an Element or even an Object.
*/
struct _GstExample
{
struct _GstExample {
GstElement element;
/* We need to keep track of our pads, so we do so here. */
GstPad *sinkpad, *srcpad;
GstPad *sinkpad,*srcpad;
/* We'll use this to decide whether to do anything to the data we get. */
gboolean active;
@ -49,12 +49,11 @@ struct _GstExample
* structure. */
typedef struct _GstExampleClass GstExampleClass;
struct _GstExampleClass
{
struct _GstExampleClass {
GstElementClass parent_class;
/* signals */
void (*asdf) (GstElement * element, GstExample * example);
void (*asdf) (GstElement *element, GstExample *example);
};
/* Five standard preprocessing macros are used in the Gtk+ object system.
@ -81,7 +80,8 @@ struct _GstExampleClass
/* This is the only prototype needed, because it is used in the above
* GST_TYPE_EXAMPLE macro.
*/
GType gst_example_get_type (void);
GType gst_example_get_type(void);
G_END_DECLS
#endif /* __GST_EXAMPLE_H__ */

View file

@ -31,26 +31,20 @@
/* struct for a node, in the search tree */
typedef struct _GstAutoplugNode GstAutoplugNode;
struct _GstAutoplugNode
{
GstAutoplugNode *prev; /* previous node */
GstElementFactory *fac; /* factory of element to connect to */
GstPadTemplate *templ; /* template which can connect */
guint cost; /* total cost to get here */
GstPadTemplate *endpoint; /* pad template that can connect to sink caps */
struct _GstAutoplugNode {
GstAutoplugNode *prev; /* previous node */
GstElementFactory *fac; /* factory of element to connect to */
GstPadTemplate *templ; /* template which can connect */
guint cost; /* total cost to get here */
GstPadTemplate *endpoint; /* pad template that can connect to sink caps */
};
/* helper functions */
gboolean gst_autoplug_caps_intersect (const GstCaps * src,
const GstCaps * sink);
GstPadTemplate *gst_autoplug_can_connect_src (GstElementFactory * fac,
const GstCaps * src);
GstPadTemplate *gst_autoplug_can_connect_sink (GstElementFactory * fac,
const GstCaps * sink);
GstPadTemplate *gst_autoplug_can_match (GstElementFactory * src,
GstElementFactory * dest);
gboolean gst_autoplug_factory_has_direction (GstElementFactory * fac,
GstPadDirection dir);
gboolean gst_autoplug_caps_intersect (const GstCaps *src, const GstCaps *sink);
GstPadTemplate * gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps *src);
GstPadTemplate * gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps *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)
#define gst_autoplug_factory_has_src(fac) gst_autoplug_factory_has_direction((fac), GST_PAD_SRC)
@ -58,15 +52,13 @@ gboolean gst_autoplug_factory_has_direction (GstElementFactory * fac,
#define gst_autoplug_get_cost(fac) 1
/* factory selections */
GList *gst_autoplug_factories_sinks (GList * factories);
GList *gst_autoplug_factories_srcs (GList * factories);
GList *gst_autoplug_factories_filters (GList * factories);
GList *gst_autoplug_factories_filters_with_sink_caps (GList * factories);
GList *gst_autoplug_factories_at_most_templates (GList * factories,
GstPadDirection dir, guint maxtemplates);
GList * gst_autoplug_factories_sinks (GList *factories);
GList * gst_autoplug_factories_srcs (GList *factories);
GList * gst_autoplug_factories_filters (GList *factories);
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 (const GstCaps * src_caps, const GstCaps * sink_caps,
GList * factories);
GList * gst_autoplug_sp (const GstCaps *src_caps, const GstCaps *sink_caps, GList *factories);
#endif /* __GST_SEARCHFUNCS_H__ */

View file

@ -26,9 +26,10 @@
#include <gst/gst.h>
#include "gstspideridentity.h"
G_BEGIN_DECLS extern GstElementDetails gst_spider_details;
G_BEGIN_DECLS
GST_DEBUG_CATEGORY_EXTERN (gst_spider_debug);
extern GstElementDetails gst_spider_details;
GST_DEBUG_CATEGORY_EXTERN(gst_spider_debug);
/*
* Theory of operation:
@ -45,16 +46,14 @@ GST_DEBUG_CATEGORY_EXTERN (gst_spider_debug);
* are refcounted once for every path.
* A GstSpider keeps a list of all GstSpiderConnections in it.
*/
typedef struct
{
typedef struct {
GstSpiderIdentity *src;
/* dunno if the path should stay here or if its too much load.
* it's at least easier then always searching it */
GList *path;
GstElement *current;
gulong signal_id;
}
GstSpiderConnection;
} GstSpiderConnection;
#define GST_TYPE_SPIDER \
(gst_spider_get_type())
@ -70,27 +69,26 @@ GstSpiderConnection;
typedef struct _GstSpider GstSpider;
typedef struct _GstSpiderClass GstSpiderClass;
struct _GstSpider
{
GstBin parent;
struct _GstSpider {
GstBin parent;
GstSpiderIdentity *sink_ident;
GList *factories; /* factories to use for plugging */
GList * factories; /* factories to use for plugging */
GList *links; /* GStSpiderConnection list of all links */
GList * links; /* GStSpiderConnection list of all links */
};
struct _GstSpiderClass
{
struct _GstSpiderClass {
GstBinClass parent_class;
};
/* default initialization stuff */
GType gst_spider_get_type (void);
GType gst_spider_get_type (void);
/* private link functions to be called by GstSpiderIdentity */
void gst_spider_identity_plug (GstSpiderIdentity * ident);
void gst_spider_identity_unplug (GstSpiderIdentity * ident);
void gst_spider_identity_plug (GstSpiderIdentity *ident);
void gst_spider_identity_unplug (GstSpiderIdentity *ident);
G_END_DECLS
#endif /* __GST_SPIDER_H__ */

View file

@ -27,6 +27,7 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_SPIDER_IDENTITY \
(gst_spider_identity_get_type())
#define GST_SPIDER_IDENTITY(obj) \
@ -37,11 +38,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SPIDER_IDENTITY))
#define GST_IS_SPIDER_IDENTITY_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SPIDER_IDENTITY))
typedef struct _GstSpiderIdentity GstSpiderIdentity;
typedef struct _GstSpiderIdentityClass GstSpiderIdentityClass;
struct _GstSpiderIdentity
{
struct _GstSpiderIdentity {
GstElement element;
/* sink and source */
@ -55,18 +56,17 @@ struct _GstSpiderIdentity
GstCaps *caps;
};
struct _GstSpiderIdentityClass
{
struct _GstSpiderIdentityClass {
GstElementClass parent_class;
};
GType gst_spider_identity_get_type (void);
GType gst_spider_identity_get_type (void);
GstSpiderIdentity *gst_spider_identity_new_sink (gchar * name);
GstSpiderIdentity *gst_spider_identity_new_src (gchar * name);
GstPad *gst_spider_identity_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name);
GstSpiderIdentity* gst_spider_identity_new_sink (gchar *name);
GstSpiderIdentity* gst_spider_identity_new_src (gchar *name);
GstPad* gst_spider_identity_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar *name);
G_END_DECLS
#endif /* __GST_SPIDER_IDENTITY_H__ */

View file

@ -26,56 +26,56 @@
#include <glib.h>
#include <setjmp.h>
typedef struct _cothread_state cothread_state;
typedef struct _cothread_context cothread_context;
typedef struct _cothread_state cothread_state;
typedef struct _cothread_context cothread_context;
typedef int (*cothread_func) (int argc, char **argv);
typedef int (*cothread_func) (int argc,char **argv);
#define COTHREAD_STARTED 0x01
#define COTHREAD_DESTROYED 0x02
struct _cothread_state
{
cothread_context *ctx;
int cothreadnum;
gpointer priv;
struct _cothread_state {
cothread_context *ctx;
int cothreadnum;
gpointer priv;
cothread_func func;
int argc;
char **argv;
cothread_func func;
int argc;
char **argv;
int flags;
void *sp;
jmp_buf jmp;
void *stack_base;
unsigned long stack_size;
int flags;
void *sp;
jmp_buf jmp;
void *stack_base;
unsigned long stack_size;
int magic_number;
int magic_number;
};
cothread_context *cothread_context_init (void);
void cothread_context_free (cothread_context * ctx);
void cothread_context_set_data (cothread_state * cothread,
gchar * key, gpointer data);
gpointer cothread_context_get_data (cothread_state * cothread, gchar * key);
cothread_context* cothread_context_init (void);
void cothread_context_free (cothread_context *ctx);
void cothread_context_set_data (cothread_state *cothread,
gchar *key, gpointer data);
gpointer cothread_context_get_data (cothread_state *cothread, gchar *key);
cothread_state *cothread_create (cothread_context * ctx);
void cothread_free (cothread_state * cothread);
void cothread_setfunc (cothread_state * cothread, cothread_func func,
int argc, char **argv);
void cothread_stop (cothread_state * cothread);
cothread_state* cothread_create (cothread_context *ctx);
void cothread_free (cothread_state *cothread);
void cothread_setfunc (cothread_state *cothread, cothread_func func,
int argc, char **argv);
void cothread_stop (cothread_state *cothread);
void cothread_switch (cothread_state * cothread);
void cothread_set_private (cothread_state * cothread, gpointer data);
gpointer cothread_get_private (cothread_state * cothread);
void cothread_switch (cothread_state *cothread);
void cothread_set_private (cothread_state *cothread,
gpointer data);
gpointer cothread_get_private (cothread_state *cothread);
void cothread_lock (cothread_state * cothread);
gboolean cothread_trylock (cothread_state * cothread);
void cothread_unlock (cothread_state * cothread);
void cothread_lock (cothread_state *cothread);
gboolean cothread_trylock (cothread_state *cothread);
void cothread_unlock (cothread_state *cothread);
cothread_state *cothread_main (cothread_context * ctx);
cothread_state *cothread_current_main (void);
cothread_state *cothread_current (void);
cothread_state* cothread_main (cothread_context *ctx);
cothread_state* cothread_current_main (void);
cothread_state* cothread_current (void);
#endif /* __COTHREAD_H__ */

View file

@ -26,13 +26,14 @@
#include <gst/gst.h>
G_BEGIN_DECLS typedef enum
{
AGGREGATOR_LOOP = 1,
G_BEGIN_DECLS
typedef enum {
AGGREGATOR_LOOP = 1,
AGGREGATOR_LOOP_SELECT,
AGGREGATOR_CHAIN
}
GstAggregatorSchedType;
} GstAggregatorSchedType;
#define GST_TYPE_AGGREGATOR \
(gst_aggregator_get_type())
@ -45,11 +46,10 @@ GstAggregatorSchedType;
#define GST_IS_AGGREGATOR_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AGGREGATOR))
typedef struct _GstAggregator GstAggregator;
typedef struct _GstAggregatorClass GstAggregatorClass;
typedef struct _GstAggregator GstAggregator;
typedef struct _GstAggregatorClass GstAggregatorClass;
struct _GstAggregator
{
struct _GstAggregator {
GstElement element;
GstPad *srcpad;
@ -63,14 +63,14 @@ struct _GstAggregator
gchar *last_message;
};
struct _GstAggregatorClass
{
struct _GstAggregatorClass {
GstElementClass parent_class;
};
GType gst_aggregator_get_type (void);
GType gst_aggregator_get_type (void);
gboolean gst_aggregator_factory_init (GstElementFactory * factory);
gboolean gst_aggregator_factory_init (GstElementFactory *factory);
G_END_DECLS
#endif /* __GST_AGGREGATOR_H__ */

View file

@ -28,42 +28,46 @@
#include <gst/gstmarshal.h>
G_BEGIN_DECLS
#define GST_TYPE_BUFFER_STORE (gst_buffer_store_get_type ())
#define GST_BUFFER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BUFFER_STORE, GstBufferStore))
#define GST_IS_BUFFER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BUFFER_STORE))
#define GST_BUFFER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BUFFER_STORE, GstBufferStoreClass))
#define GST_IS_BUFFER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_BUFFER_STORE))
#define GST_BUFFER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BUFFER_STORE, GstBufferStoreClass))
typedef struct _GstBufferStore GstBufferStore;
typedef struct _GstBufferStoreClass GstBufferStoreClass;
struct _GstBufferStore
{
GObject object;
typedef struct _GstBufferStore GstBufferStore;
typedef struct _GstBufferStoreClass GstBufferStoreClass;
GList *buffers;
struct _GstBufferStore {
GObject object;
GList * buffers;
};
struct _GstBufferStoreClass
{
GObjectClass parent_class;
struct _GstBufferStoreClass {
GObjectClass parent_class;
/* signals */
void (*cleared) (GstBufferStore * store);
gboolean (*buffer_added) (GstBufferStore * store, GstBuffer * buffer);
void (* cleared) (GstBufferStore * store);
gboolean (* buffer_added) (GstBufferStore * store,
GstBuffer * buffer);
};
GType gst_buffer_store_get_type (void);
GType gst_buffer_store_get_type (void);
GstBufferStore *gst_buffer_store_new (void);
void gst_buffer_store_clear (GstBufferStore * store);
GstBufferStore * gst_buffer_store_new (void);
void gst_buffer_store_clear (GstBufferStore * store);
gboolean gst_buffer_store_add_buffer (GstBufferStore * store,
GstBuffer * buffer);
gboolean gst_buffer_store_add_buffer (GstBufferStore * store,
GstBuffer * buffer);
GstBuffer *gst_buffer_store_get_buffer (GstBufferStore * store,
guint64 offset, guint size);
guint gst_buffer_store_get_size (GstBufferStore * store, guint64 offset);
GstBuffer * gst_buffer_store_get_buffer (GstBufferStore * store,
guint64 offset,
guint size);
guint gst_buffer_store_get_size (GstBufferStore * store,
guint64 offset);
G_END_DECLS
#endif /* __GST_BUFFER_STORE_H__ */

View file

@ -27,6 +27,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_FAKESINK \
(gst_fakesink_get_type())
#define GST_FAKESINK(obj) \
@ -37,8 +39,8 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FAKESINK))
#define GST_IS_FAKESINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FAKESINK))
typedef enum
{
typedef enum {
FAKESINK_STATE_ERROR_NONE = 0,
FAKESINK_STATE_ERROR_NULL_READY,
FAKESINK_STATE_ERROR_READY_PAUSED,
@ -46,37 +48,35 @@ G_BEGIN_DECLS
FAKESINK_STATE_ERROR_PLAYING_PAUSED,
FAKESINK_STATE_ERROR_PAUSED_READY,
FAKESINK_STATE_ERROR_READY_NULL,
}
GstFakeSinkStateError;
} GstFakeSinkStateError;
typedef struct _GstFakeSink GstFakeSink;
typedef struct _GstFakeSinkClass GstFakeSinkClass;
struct _GstFakeSink
{
GstElement element;
struct _GstFakeSink {
GstElement element;
gboolean silent;
gboolean dump;
gboolean sync;
gboolean signal_handoffs;
GstClock *clock;
gboolean silent;
gboolean dump;
gboolean sync;
gboolean signal_handoffs;
GstClock *clock;
GstFakeSinkStateError state_error;
gchar *last_message;
gchar *last_message;
};
struct _GstFakeSinkClass
{
struct _GstFakeSinkClass {
GstElementClass parent_class;
/* signals */
void (*handoff) (GstElement * element, GstBuffer * buf, GstPad * pad);
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
GType gst_fakesink_get_type (void);
GType gst_fakesink_get_type(void);
gboolean gst_fakesink_factory_init (GstElementFactory * factory);
gboolean gst_fakesink_factory_init (GstElementFactory *factory);
G_END_DECLS
#endif /* __GST_FAKESINK_H__ */

View file

@ -26,8 +26,10 @@
#include <gst/gst.h>
G_BEGIN_DECLS typedef enum
{
G_BEGIN_DECLS
typedef enum {
FAKESRC_FIRST_LAST_LOOP = 1,
FAKESRC_LAST_FIRST_LOOP,
FAKESRC_PING_PONG,
@ -36,33 +38,26 @@ G_BEGIN_DECLS typedef enum
FAKESRC_PATTERN_LOOP,
FAKESRC_PING_PONG_PATTERN,
FAKESRC_GET_ALWAYS_SUCEEDS
}
GstFakeSrcOutputType;
} GstFakeSrcOutputType;
typedef enum
{
typedef enum {
FAKESRC_DATA_ALLOCATE = 1,
FAKESRC_DATA_SUBBUFFER,
}
GstFakeSrcDataType;
} GstFakeSrcDataType;
typedef enum
{
typedef enum {
FAKESRC_SIZETYPE_NULL = 1,
FAKESRC_SIZETYPE_FIXED,
FAKESRC_SIZETYPE_RANDOM
}
GstFakeSrcSizeType;
} GstFakeSrcSizeType;
typedef enum
{
typedef enum {
FAKESRC_FILLTYPE_NOTHING = 1,
FAKESRC_FILLTYPE_NULL,
FAKESRC_FILLTYPE_RANDOM,
FAKESRC_FILLTYPE_PATTERN,
FAKESRC_FILLTYPE_PATTERN_CONT
}
GstFakeSrcFillType;
} GstFakeSrcFillType;
#define GST_TYPE_FAKESRC \
(gst_fakesrc_get_type())
@ -78,51 +73,50 @@ GstFakeSrcFillType;
typedef struct _GstFakeSrc GstFakeSrc;
typedef struct _GstFakeSrcClass GstFakeSrcClass;
struct _GstFakeSrc
{
GstElement element;
struct _GstFakeSrc {
GstElement element;
gboolean loop_based;
gboolean eos;
gboolean loop_based;
gboolean eos;
GstFakeSrcOutputType output;
GstFakeSrcDataType data;
GstFakeSrcSizeType sizetype;
GstFakeSrcFillType filltype;
GstFakeSrcDataType data;
GstFakeSrcSizeType sizetype;
GstFakeSrcFillType filltype;
guint sizemin;
guint sizemax;
GstBuffer *parent;
guint parentsize;
guint parentoffset;
guint8 pattern_byte;
gchar *pattern;
GList *patternlist;
gint64 segment_start;
gint64 segment_end;
gboolean segment_loop;
gint num_buffers;
gint rt_num_buffers; /* we are going to change this at runtime */
guint64 buffer_count;
gboolean silent;
gboolean signal_handoffs;
gboolean dump;
gboolean need_flush;
guint sizemin;
guint sizemax;
GstBuffer *parent;
guint parentsize;
guint parentoffset;
guint8 pattern_byte;
gchar *pattern;
GList *patternlist;
gint64 segment_start;
gint64 segment_end;
gboolean segment_loop;
gint num_buffers;
gint rt_num_buffers; /* we are going to change this at runtime */
guint64 buffer_count;
gboolean silent;
gboolean signal_handoffs;
gboolean dump;
gboolean need_flush;
gchar *last_message;
gchar *last_message;
};
struct _GstFakeSrcClass
{
struct _GstFakeSrcClass {
GstElementClass parent_class;
/* signals */
void (*handoff) (GstElement * element, GstBuffer * buf, GstPad * pad);
void (*handoff) (GstElement *element, GstBuffer *buf, GstPad *pad);
};
GType gst_fakesrc_get_type (void);
GType gst_fakesrc_get_type(void);
gboolean gst_fakesrc_factory_init (GstElementFactory * factory);
gboolean gst_fakesrc_factory_init (GstElementFactory *factory);
G_END_DECLS
#endif /* __GST_FAKESRC_H__ */

View file

@ -27,6 +27,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_FDSINK \
(gst_fdsink_get_type())
#define GST_FDSINK(obj) \
@ -37,11 +39,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FDSINK))
#define GST_IS_FDSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSINK))
typedef struct _GstFdSink GstFdSink;
typedef struct _GstFdSinkClass GstFdSinkClass;
struct _GstFdSink
{
struct _GstFdSink {
GstElement element;
GstPad *sinkpad;
@ -49,12 +51,12 @@ struct _GstFdSink
int fd;
};
struct _GstFdSinkClass
{
struct _GstFdSinkClass {
GstElementClass parent_class;
};
GType gst_fdsink_get_type (void);
GType gst_fdsink_get_type(void);
G_END_DECLS
#endif /* __GST_FDSINK_H__ */

View file

@ -27,6 +27,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_FDSRC \
(gst_fdsrc_get_type())
#define GST_FDSRC(obj) \
@ -37,11 +39,12 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FDSRC))
#define GST_IS_FDSRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FDSRC))
typedef struct _GstFdSrc GstFdSrc;
typedef struct _GstFdSrcClass GstFdSrcClass;
struct _GstFdSrc
{
struct _GstFdSrc {
GstElement element;
/* pads */
GstPad *srcpad;
@ -49,22 +52,22 @@ struct _GstFdSrc
/* fd */
gint fd;
gulong curoffset; /* current offset in file */
gulong blocksize; /* bytes per read */
guint64 timeout; /* read timeout, in nanoseconds */
gulong curoffset; /* current offset in file */
gulong blocksize; /* bytes per read */
guint64 timeout; /* read timeout, in nanoseconds */
gulong seq; /* buffer sequence number */
gulong seq; /* buffer sequence number */
};
struct _GstFdSrcClass
{
struct _GstFdSrcClass {
GstElementClass parent_class;
/* signals */
void (*timeout) (GstElement * element);
void (*timeout) (GstElement *element);
};
GType gst_fdsrc_get_type (void);
GType gst_fdsrc_get_type(void);
G_END_DECLS
#endif /* __GST_FDSRC_H__ */

View file

@ -27,6 +27,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_FILESINK \
(gst_filesink_get_type())
#define GST_FILESINK(obj) \
@ -37,19 +39,17 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILESINK))
#define GST_IS_FILESINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILESINK))
typedef struct _GstFileSink GstFileSink;
typedef struct _GstFileSinkClass GstFileSinkClass;
typedef enum
{
GST_FILESINK_OPEN = GST_ELEMENT_FLAG_LAST,
typedef enum {
GST_FILESINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_FILESINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
}
GstFileSinkFlags;
GST_FILESINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
} GstFileSinkFlags;
struct _GstFileSink
{
struct _GstFileSink {
GstElement element;
gchar *filename;
@ -59,15 +59,15 @@ struct _GstFileSink
guint64 data_written;
};
struct _GstFileSinkClass
{
struct _GstFileSinkClass {
GstElementClass parent_class;
/* signals */
void (*handoff) (GstElement * element, GstPad * pad);
void (*handoff) (GstElement *element, GstPad *pad);
};
GType gst_filesink_get_type (void);
GType gst_filesink_get_type(void);
G_END_DECLS
#endif /* __GST_FILESINK_H__ */

View file

@ -29,6 +29,8 @@
#include <sys/types.h>
G_BEGIN_DECLS
#define GST_TYPE_FILESRC \
(gst_filesrc_get_type())
#define GST_FILESRC(obj) \
@ -39,32 +41,30 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FILESRC))
#define GST_IS_FILESRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FILESRC))
typedef enum
{
GST_FILESRC_OPEN = GST_ELEMENT_FLAG_LAST,
typedef enum {
GST_FILESRC_OPEN = GST_ELEMENT_FLAG_LAST,
GST_FILESRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
}
GstFileSrcFlags;
} GstFileSrcFlags;
typedef struct _GstFileSrc GstFileSrc;
typedef struct _GstFileSrcClass GstFileSrcClass;
struct _GstFileSrc
{
struct _GstFileSrc {
GstElement element;
GstPad *srcpad;
guint pagesize; /* system page size */
guint pagesize; /* system page size*/
gchar *filename; /* filename */
gchar *uri; /* caching the URI */
gint fd; /* open file descriptor */
off_t filelen; /* what's the file length? */
gchar *filename; /* filename */
gchar *uri; /* caching the URI */
gint fd; /* open file descriptor*/
off_t filelen; /* what's the file length?*/
off_t curoffset; /* current offset in file */
off_t block_size; /* bytes per read */
gboolean touch; /* whether to touch every page */
off_t curoffset; /* current offset in file*/
off_t block_size; /* bytes per read */
gboolean touch; /* whether to touch every page */
gboolean using_mmap;
GstBuffer *mapbuf;
@ -74,12 +74,12 @@ struct _GstFileSrc
gboolean need_flush;
};
struct _GstFileSrcClass
{
struct _GstFileSrcClass {
GstElementClass parent_class;
};
GType gst_filesrc_get_type (void);
GType gst_filesrc_get_type(void);
G_END_DECLS
#endif /* __GST_FILESRC_H__ */

View file

@ -28,6 +28,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_IDENTITY \
(gst_identity_get_type())
#define GST_IDENTITY(obj) \
@ -38,36 +40,36 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_IDENTITY))
#define GST_IS_IDENTITY_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_IDENTITY))
typedef struct _GstIdentity GstIdentity;
typedef struct _GstIdentityClass GstIdentityClass;
struct _GstIdentity
{
GstElement element;
struct _GstIdentity {
GstElement element;
GstPad *sinkpad;
GstPad *srcpad;
GstPad *sinkpad;
GstPad *srcpad;
gboolean loop_based;
guint duplicate;
gint error_after;
gfloat drop_probability;
guint sleep_time;
gboolean silent;
gboolean dump;
gchar *last_message;
GstCaps *srccaps;
gboolean loop_based;
guint duplicate;
gint error_after;
gfloat drop_probability;
guint sleep_time;
gboolean silent;
gboolean dump;
gchar *last_message;
GstCaps *srccaps;
};
struct _GstIdentityClass
{
struct _GstIdentityClass {
GstElementClass parent_class;
/* signals */
void (*handoff) (GstElement * element, GstBuffer * buf);
void (*handoff) (GstElement *element, GstBuffer *buf);
};
GType gst_identity_get_type (void);
GType gst_identity_get_type(void);
G_END_DECLS
#endif /* __GST_IDENTITY_H__ */

View file

@ -28,6 +28,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_MD5SINK \
(gst_md5sink_get_type())
#define GST_MD5SINK(obj) \
@ -38,11 +40,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MD5SINK))
#define GST_IS_MD5SINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MD5SINK))
typedef struct _GstMD5Sink GstMD5Sink;
typedef struct _GstMD5SinkClass GstMD5SinkClass;
struct _GstMD5Sink
{
struct _GstMD5Sink {
GstElement element;
/* md5 information */
@ -60,15 +62,15 @@ struct _GstMD5Sink
};
struct _GstMD5SinkClass
{
struct _GstMD5SinkClass {
GstElementClass parent_class;
};
GType gst_md5sink_get_type (void);
GType gst_md5sink_get_type (void);
gboolean gst_md5sink_factory_init (GstElementFactory * factory);
gboolean gst_md5sink_factory_init (GstElementFactory *factory);
G_END_DECLS
#endif /* __GST_MD5SINK_H__ */

View file

@ -27,6 +27,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_MULTIFILESRC \
(gst_multifilesrc_get_type())
#define GST_MULTIFILESRC(obj) \
@ -37,43 +39,41 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIFILESRC))
#define GST_IS_MULTIFILESRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIFILESRC))
typedef enum
{
GST_MULTIFILESRC_OPEN = GST_ELEMENT_FLAG_LAST,
GST_MULTIFILESRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
}
GstMultiFileSrcFlags;
typedef enum {
GST_MULTIFILESRC_OPEN = GST_ELEMENT_FLAG_LAST,
GST_MULTIFILESRC_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
} GstMultiFileSrcFlags;
typedef struct _GstMultiFileSrc GstMultiFileSrc;
typedef struct _GstMultiFileSrcClass GstMultiFileSrcClass;
struct _GstMultiFileSrc
{
struct _GstMultiFileSrc {
GstElement element;
/* pads */
GstPad *srcpad;
/* current file details */
gchar *currentfilename;
gchar *currentfilename;
GSList *listptr;
/* mapping parameters */
gint fd;
gulong size; /* how long is the file? */
guchar *map; /* where the file is mapped to */
gulong size; /* how long is the file? */
guchar *map; /* where the file is mapped to */
gboolean new_seek;
};
struct _GstMultiFileSrcClass
{
struct _GstMultiFileSrcClass {
GstElementClass parent_class;
void (*new_file) (GstMultiFileSrc * multifilesrc, gchar * newfilename);
void (*new_file) (GstMultiFileSrc *multifilesrc, gchar *newfilename);
};
GType gst_multifilesrc_get_type (void);
GType gst_multifilesrc_get_type(void);
G_END_DECLS
#endif /* __GST_MULTIFILESRC_H__ */

View file

@ -28,6 +28,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_PIPEFILTER \
(gst_pipefilter_get_type())
#define GST_PIPEFILTER(obj) \
@ -38,19 +40,17 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PIPEFILTER))
#define GST_IS_PIPEFILTER_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PIPEFILTER))
typedef enum
{
GST_PIPEFILTER_OPEN = GST_ELEMENT_FLAG_LAST,
GST_PIPEFILTER_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
}
GstPipeFilterFlags;
typedef enum {
GST_PIPEFILTER_OPEN = GST_ELEMENT_FLAG_LAST,
GST_PIPEFILTER_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2
} GstPipeFilterFlags;
typedef struct _GstPipefilter GstPipefilter;
typedef struct _GstPipefilterClass GstPipefilterClass;
struct _GstPipefilter
{
struct _GstPipefilter {
GstElement element;
GstPad *sinkpad;
@ -62,20 +62,20 @@ struct _GstPipefilter
/* fd */
gint fdout[2];
gint fdin[2];
pid_t childpid;
pid_t childpid;
gulong curoffset; /* current offset in file */
gulong bytes_per_read; /* bytes per read */
gulong curoffset; /* current offset in file */
gulong bytes_per_read; /* bytes per read */
gulong seq; /* buffer sequence number */
gulong seq; /* buffer sequence number */
};
struct _GstPipefilterClass
{
struct _GstPipefilterClass {
GstElementClass parent_class;
};
GType gst_pipefilter_get_type (void);
GType gst_pipefilter_get_type(void);
G_END_DECLS
#endif /* __GST_PIPEFILTER_H__ */

View file

@ -28,6 +28,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_SHAPER \
(gst_shaper_get_type())
#define GST_SHAPER(obj) \
@ -38,37 +40,35 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SHAPER))
#define GST_IS_SHAPER_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SHAPER))
typedef enum
{
typedef enum {
SHAPER_POLICY_TIMESTAMPS = 1,
SHAPER_POLICY_BUFFERSIZE
}
GstShaperPolicyType;
} GstShaperPolicyType;
typedef struct _GstShaper GstShaper;
typedef struct _GstShaperClass GstShaperClass;
struct _GstShaper
{
GstElement element;
struct _GstShaper {
GstElement element;
GSList *connections;
gint nconnections;
GSList *connections;
gint nconnections;
GstShaperPolicyType policy;
GstShaperPolicyType policy;
gboolean silent;
gchar *last_message;
gboolean silent;
gchar *last_message;
};
struct _GstShaperClass
{
struct _GstShaperClass {
GstElementClass parent_class;
};
GType gst_shaper_get_type (void);
gboolean gst_shaper_factory_init (GstElementFactory * factory);
GType gst_shaper_get_type (void);
gboolean gst_shaper_factory_init (GstElementFactory *factory);
G_END_DECLS
#endif /* __GST_SHAPER_H__ */

View file

@ -27,6 +27,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_STATISTICS \
(gst_statistics_get_type())
#define GST_STATISTICS(obj) \
@ -37,20 +39,19 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_STATISTICS))
#define GST_IS_STATISTICS_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_STATISTICS))
typedef struct _GstStatistics GstStatistics;
typedef struct _GstStatisticsClass GstStatisticsClass;
typedef struct _stats stats;
struct _stats
{
struct _stats {
gint64 buffers;
gint64 bytes;
gint64 events;
};
struct _GstStatistics
{
struct _GstStatistics {
GstElement element;
GstPad *sinkpad;
@ -69,15 +70,15 @@ struct _GstStatistics
gboolean silent;
};
struct _GstStatisticsClass
{
struct _GstStatisticsClass {
GstElementClass parent_class;
/* signals */
void (*update) (GstElement * element);
void (*update) (GstElement *element);
};
GType gst_statistics_get_type (void);
GType gst_statistics_get_type(void);
G_END_DECLS
#endif /* __GST_STATISTICS_H__ */

View file

@ -27,6 +27,8 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_TEE \
(gst_tee_get_type())
#define GST_TEE(obj) \
@ -37,27 +39,27 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TEE))
#define GST_IS_TEE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TEE))
typedef struct _GstTee GstTee;
typedef struct _GstTeeClass GstTeeClass;
struct _GstTee
{
typedef struct _GstTee GstTee;
typedef struct _GstTeeClass GstTeeClass;
struct _GstTee {
GstElement element;
GstPad *sinkpad;
gboolean silent;
gchar *last_message;
gchar *last_message;
};
struct _GstTeeClass
{
struct _GstTeeClass {
GstElementClass parent_class;
};
GType gst_tee_get_type (void);
GType gst_tee_get_type (void);
gboolean gst_tee_factory_init (GstElementFactory * factory);
gboolean gst_tee_factory_init (GstElementFactory *factory);
G_END_DECLS
#endif /* __GST_TEE_H__ */

View file

@ -29,44 +29,48 @@
#include "gstbufferstore.h"
G_BEGIN_DECLS
#define GST_TYPE_TYPE_FIND_ELEMENT (gst_type_find_element_get_type ())
#define GST_TYPE_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElement))
#define GST_IS_TYPE_FIND_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TYPE_FIND_ELEMENT))
#define GST_TYPE_FIND_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElementClass))
#define GST_IS_TYPE_FIND_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TYPE_FIND_ELEMENT))
#define GST_TYPE_FIND_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_TYPE_FIND_ELEMENT, GstTypeFindElementClass))
typedef struct _GstTypeFindElement GstTypeFindElement;
typedef struct _GstTypeFindElementClass GstTypeFindElementClass;
struct _GstTypeFindElement
{
GstElement element;
typedef struct _GstTypeFindElement GstTypeFindElement;
typedef struct _GstTypeFindElementClass GstTypeFindElementClass;
GstPad *sink;
GstPad *src;
struct _GstTypeFindElement {
GstElement element;
guint min_probability;
guint max_probability;
GstCaps *caps;
GstPad * sink;
GstPad * src;
guint mode;
GstBufferStore *store;
guint64 stream_length;
gboolean stream_length_available;
guint min_probability;
guint max_probability;
GstCaps * caps;
GList *possibilities;
guint mode;
GstBufferStore * store;
guint64 stream_length;
gboolean stream_length_available;
GList * possibilities;
};
struct _GstTypeFindElementClass
{
GstElementClass parent_class;
struct _GstTypeFindElementClass {
GstElementClass parent_class;
/* signals */
void (*have_type) (GstTypeFindElement * element,
guint probability, const GstCaps * caps);
void (*have_type) (GstTypeFindElement *element,
guint probability,
const GstCaps * caps);
};
GType gst_type_find_element_get_type (void);
G_END_DECLS
#endif /* __GST_TYPE_FIND_ELEMENT_H__ */

View file

@ -23,7 +23,7 @@
#ifndef __GST_I18N_APP_H__
#define __GST_I18N_APP_H__
#include "gettext.h" /* included with gettext distribution and copied */
#include "gettext.h" /* included with gettext distribution and copied */
/* we want to use shorthand _() for translating and N_() for marking */
#define _(String) gettext (String)

View file

@ -23,7 +23,7 @@
#ifndef __GST_I18N_LIB_H__
#define __GST_I18N_LIB_H__
#include "gettext.h" /* included with gettext distribution and copied */
#include "gettext.h" /* included with gettext distribution and copied */
#ifndef GETTEXT_PACKAGE
#error You must define GETTEXT_PACKAGE before including this header.

View file

@ -69,26 +69,31 @@
#include <gst/gstcompat.h>
G_BEGIN_DECLS
/* make our own type for poptOption because the struct poptOption
* definition is iffy */
typedef struct poptOption GstPoptOption;
/* initialize GST */
void gst_init (int *argc, char **argv[]);
gboolean gst_init_check (int *argc, char **argv[]);
void gst_init_with_popt_table (int *argc, char **argv[],
const GstPoptOption * popt_options);
gboolean gst_init_check_with_popt_table (int *argc, char **argv[],
const GstPoptOption * popt_options);
void gst_init (int *argc, char **argv[]);
gboolean gst_init_check (int *argc, char **argv[]);
void gst_init_with_popt_table (int *argc, char **argv[],
const GstPoptOption
*popt_options);
gboolean gst_init_check_with_popt_table (int *argc, char **argv[],
const GstPoptOption
*popt_options);
const GstPoptOption *gst_init_get_popt_table (void);
const GstPoptOption * gst_init_get_popt_table (void);
void gst_use_threads (gboolean use_threads);
gboolean gst_has_threads (void);
void gst_use_threads (gboolean use_threads);
gboolean gst_has_threads (void);
void gst_main (void);
void gst_main_quit (void);
void gst_main (void);
void gst_main_quit (void);
G_END_DECLS
#include <gst/gstlog.h>
#endif /* __GST_H__ */

View file

@ -53,12 +53,11 @@
"mtlr r0\n\t" \
"blrl" : : "r"(target) );
struct minimal_ppc_stackframe
{
unsigned long back_chain;
unsigned long LR_save;
unsigned long unused1;
unsigned long unused2;
struct minimal_ppc_stackframe {
unsigned long back_chain;
unsigned long LR_save;
unsigned long unused1;
unsigned long unused2;
};
#define GST_ARCH_SETUP_STACK(sp) \
@ -80,12 +79,11 @@ struct minimal_ppc_stackframe
/* Need to get more information about the stackframe format
* and get the fields more correct. Check GDB sources maybe?
*/
struct minimal_stackframe
{
unsigned long back_chain;
unsigned long LR_save;
unsigned long unused1;
unsigned long unused2;
struct minimal_stackframe {
unsigned long back_chain;
unsigned long LR_save;
unsigned long unused1;
unsigned long unused2;
};
#define GST_ARCH_SETUP_STACK(sp) \
@ -169,12 +167,11 @@ struct minimal_stackframe
#define GST_ARCH_CALL(target) \
__asm__( "basr 14,%0" : : "a"(target) );
struct minimal_s390_stackframe
{
unsigned long back_chain;
unsigned long reserved;
unsigned long greg[14];
double freg[4];
struct minimal_s390_stackframe {
unsigned long back_chain;
unsigned long reserved;
unsigned long greg[14];
double freg[4];
};
#define GST_ARCH_SETUP_STACK(sp) \

View file

@ -22,25 +22,27 @@
#include <glib.h>
G_BEGIN_DECLS typedef volatile gint gst_vgint; /* gtk-doc volatile workaround */
G_BEGIN_DECLS
typedef volatile gint gst_vgint; /* gtk-doc volatile workaround */
typedef struct _GstAtomicInt GstAtomicInt;
struct _GstAtomicInt
{
gst_vgint counter;
GMutex *lock; /* for C fallback */
struct _GstAtomicInt {
gst_vgint counter;
GMutex *lock; /* for C fallback */
};
void gst_atomic_int_init (GstAtomicInt * aint, gint val);
void gst_atomic_int_destroy (GstAtomicInt * aint);
void gst_atomic_int_set (GstAtomicInt * aint, gint val);
gint gst_atomic_int_read (GstAtomicInt * aint);
void gst_atomic_int_add (GstAtomicInt * aint, gint val);
void gst_atomic_int_inc (GstAtomicInt * aint);
gboolean gst_atomic_int_dec_and_test (GstAtomicInt * aint);
void gst_atomic_int_init (GstAtomicInt *aint, gint val);
void gst_atomic_int_destroy (GstAtomicInt *aint);
void gst_atomic_int_set (GstAtomicInt *aint, gint val);
gint gst_atomic_int_read (GstAtomicInt *aint);
void gst_atomic_int_add (GstAtomicInt *aint, gint val);
void gst_atomic_int_inc (GstAtomicInt *aint);
gboolean gst_atomic_int_dec_and_test (GstAtomicInt *aint);
G_END_DECLS
#endif /* __GST_ATOMIC_H__ */

View file

@ -34,62 +34,57 @@
#include "gstmacros.h"
G_BEGIN_DECLS
#if defined (GST_CAN_INLINE) || defined (__GST_ATOMIC_C__)
/***** Intel x86 *****/
#if defined (HAVE_CPU_I386) && defined(__GNUC__)
#ifdef GST_CONFIG_NO_SMP
#define SMP_LOCK ""
#else
#define SMP_LOCK "lock ; "
#endif
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC void
gst_atomic_int_destroy (GstAtomicInt * aint)
{
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
{
return aint->counter;
}
GST_INLINE_FUNC void gst_atomic_int_init (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC void gst_atomic_int_destroy (GstAtomicInt *aint) { }
GST_INLINE_FUNC void gst_atomic_int_set (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC gint gst_atomic_int_read (GstAtomicInt *aint) { return aint->counter; }
GST_INLINE_FUNC void
gst_atomic_int_add (GstAtomicInt * aint, gint val)
gst_atomic_int_add (GstAtomicInt *aint, gint val)
{
__asm__ __volatile__ (SMP_LOCK "addl %1,%0":"=m" (aint->counter)
__asm__ __volatile__(
SMP_LOCK "addl %1,%0"
:"=m" (aint->counter)
:"ir" (val), "m" (aint->counter));
}
GST_INLINE_FUNC void
gst_atomic_int_inc (GstAtomicInt * aint)
gst_atomic_int_inc (GstAtomicInt *aint)
{
__asm__ __volatile__ (SMP_LOCK "incl %0":"=m" (aint->counter)
__asm__ __volatile__(
SMP_LOCK "incl %0"
:"=m" (aint->counter)
:"m" (aint->counter));
}
GST_INLINE_FUNC gboolean
gst_atomic_int_dec_and_test (GstAtomicInt * aint)
gst_atomic_int_dec_and_test (GstAtomicInt *aint)
{
guchar res;
__asm__ __volatile__ (SMP_LOCK "decl %0; sete %1":"=m" (aint->counter),
"=qm" (res)
:"m" (aint->counter):"memory");
__asm__ __volatile__(
SMP_LOCK "decl %0; sete %1"
:"=m" (aint->counter), "=qm" (res)
:"m" (aint->counter) : "memory");
return res != 0;
}
/***** PowerPC *****/
#elif defined (HAVE_CPU_PPC) && defined(__GNUC__)
#ifdef GST_CONFIG_NO_SMP
#define SMP_SYNC ""
#define SMP_ISYNC
@ -97,6 +92,7 @@ gst_atomic_int_dec_and_test (GstAtomicInt * aint)
#define SMP_SYNC "\tsync\n"
#define SMP_ISYNC "\tisync\n"
#endif
/* Erratum #77 on the 405 means we need a sync or dcbt before every stwcx.
* The old ATOMIC_SYNC_FIX covered some but not all of this.
*/
@ -105,123 +101,111 @@ gst_atomic_int_dec_and_test (GstAtomicInt * aint)
#else
#define PPC405_ERR77(ra,rb)
#endif
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC void
gst_atomic_int_destroy (GstAtomicInt * aint)
{
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
{
return aint->counter;
}
GST_INLINE_FUNC void gst_atomic_int_init (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC void gst_atomic_int_destroy (GstAtomicInt *aint) { }
GST_INLINE_FUNC void gst_atomic_int_set (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC gint gst_atomic_int_read (GstAtomicInt *aint) { return aint->counter; }
GST_INLINE_FUNC void
gst_atomic_int_add (GstAtomicInt * aint, gint val)
gst_atomic_int_add (GstAtomicInt *aint, gint val)
{
int t;
__asm__ __volatile__ ("1: lwarx %0,0,%3\n"
" add %0,%2,%0\n" PPC405_ERR77 (0, %3)
" stwcx. %0,0,%3 \n"
" bne- 1b\n":"=&r" (t), "=m" (aint->counter)
:"r" (val), "r" (&aint->counter), "m" (aint->counter)
:"cc");
__asm__ __volatile__(
"1: lwarx %0,0,%3\n"
" add %0,%2,%0\n"
PPC405_ERR77(0,%3)
" stwcx. %0,0,%3 \n"
" bne- 1b\n"
: "=&r" (t), "=m" (aint->counter)
: "r" (val), "r" (&aint->counter), "m" (aint->counter)
: "cc");
}
GST_INLINE_FUNC void
gst_atomic_int_inc (GstAtomicInt * aint)
gst_atomic_int_inc (GstAtomicInt *aint)
{
int t;
__asm__ __volatile__ ("1: lwarx %0,0,%2\n"
" addic %0,%0,1\n" PPC405_ERR77 (0, %2)
" stwcx. %0,0,%2\n"
" bne- 1b\n":"=&r" (t), "=m" (aint->counter)
:"r" (&aint->counter), "m" (aint->counter)
:"cc");
__asm__ __volatile__(
"1: lwarx %0,0,%2\n"
" addic %0,%0,1\n"
PPC405_ERR77(0,%2)
" stwcx. %0,0,%2\n"
" bne- 1b\n"
: "=&r" (t), "=m" (aint->counter)
: "r" (&aint->counter), "m" (aint->counter)
: "cc");
}
GST_INLINE_FUNC gboolean
gst_atomic_int_dec_and_test (GstAtomicInt * aint)
gst_atomic_int_dec_and_test (GstAtomicInt *aint)
{
int t;
__asm__ __volatile__ ("1: lwarx %0,0,%1\n"
" addic %0,%0,-1\n" PPC405_ERR77 (0, %1)
" stwcx. %0,0,%1\n" " bne- 1b\n" SMP_ISYNC:"=&r" (t)
:"r" (&aint->counter)
:"cc", "memory");
__asm__ __volatile__(
"1: lwarx %0,0,%1\n"
" addic %0,%0,-1\n"
PPC405_ERR77(0,%1)
" stwcx. %0,0,%1\n"
" bne- 1b\n"
SMP_ISYNC
: "=&r" (t)
: "r" (&aint->counter)
: "cc", "memory");
return t == 0;
}
/***** DEC[/Compaq/HP?/Intel?] Alpha *****/
#elif defined(HAVE_CPU_ALPHA) && defined(__GNUC__)
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC void
gst_atomic_int_destroy (GstAtomicInt * aint)
{
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
{
return aint->counter;
}
GST_INLINE_FUNC void gst_atomic_int_init (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC void gst_atomic_int_destroy (GstAtomicInt *aint) { }
GST_INLINE_FUNC void gst_atomic_int_set (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC gint gst_atomic_int_read (GstAtomicInt *aint) { return aint->counter; }
GST_INLINE_FUNC void
gst_atomic_int_add (GstAtomicInt * aint, gint val)
gst_atomic_int_add (GstAtomicInt *aint, gint val)
{
unsigned long temp;
__asm__ __volatile__ ("1: ldl_l %0,%1\n"
" addl %0,%2,%0\n"
" stl_c %0,%1\n"
" beq %0,2f\n"
".subsection 2\n"
"2: br 1b\n" ".previous":"=&r" (temp), "=m" (aint->counter)
__asm__ __volatile__(
"1: ldl_l %0,%1\n"
" addl %0,%2,%0\n"
" stl_c %0,%1\n"
" beq %0,2f\n"
".subsection 2\n"
"2: br 1b\n"
".previous"
:"=&r" (temp), "=m" (aint->counter)
:"Ir" (val), "m" (aint->counter));
}
GST_INLINE_FUNC void
gst_atomic_int_inc (GstAtomicInt * aint)
gst_atomic_int_inc (GstAtomicInt *aint)
{
gst_atomic_int_add (aint, 1);
}
GST_INLINE_FUNC gboolean
gst_atomic_int_dec_and_test (GstAtomicInt * aint)
gst_atomic_int_dec_and_test (GstAtomicInt *aint)
{
long temp, result;
int val = 1;
__asm__ __volatile__ ("1: ldl_l %0,%1\n"
" subl %0,%3,%2\n"
" subl %0,%3,%0\n"
" stl_c %0,%1\n"
" beq %0,2f\n"
" mb\n"
".subsection 2\n"
"2: br 1b\n"
".previous":"=&r" (temp), "=m" (aint->counter), "=&r" (result)
:"Ir" (val), "m" (aint->counter):"memory");
__asm__ __volatile__(
"1: ldl_l %0,%1\n"
" subl %0,%3,%2\n"
" subl %0,%3,%0\n"
" stl_c %0,%1\n"
" beq %0,2f\n"
" mb\n"
".subsection 2\n"
"2: br 1b\n"
".previous"
:"=&r" (temp), "=m" (aint->counter), "=&r" (result)
:"Ir" (val), "m" (aint->counter) : "memory");
return result == 0;
}
@ -229,38 +213,16 @@ gst_atomic_int_dec_and_test (GstAtomicInt * aint)
/***** Sun SPARC *****/
#elif 0 && defined(HAVE_CPU_SPARC) && defined(__GNUC__)
/* allegedly broken again */
GST_INLINE_FUNC void
gst_atomic_int_destroy (GstAtomicInt * aint)
{
}
GST_INLINE_FUNC void gst_atomic_int_destroy (GstAtomicInt *aint) { }
#ifdef GST_CONFIG_NO_SMP
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
{
return aint->counter;
}
GST_INLINE_FUNC void gst_atomic_int_init (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC void gst_atomic_int_set (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC gint gst_atomic_int_read (GstAtomicInt *aint) { return aint->counter; }
#else
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
{
aint->counter = (val << 8);
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
{
aint->counter = (val << 8);
}
GST_INLINE_FUNC void gst_atomic_int_init (GstAtomicInt *aint, gint val) { aint->counter = (val<<8); }
GST_INLINE_FUNC void gst_atomic_int_set (GstAtomicInt *aint, gint val) { aint->counter = (val<<8); }
/*
* For SMP the trick is you embed the spin lock byte within
@ -273,7 +235,7 @@ gst_atomic_int_set (GstAtomicInt * aint, gint val)
* 31 8 7 0
*/
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
gst_atomic_int_read (GstAtomicInt *aint)
{
int ret = aint->counter;
@ -285,7 +247,7 @@ gst_atomic_int_read (GstAtomicInt * aint)
#endif /* GST_CONFIG_NO_SMP */
GST_INLINE_FUNC void
gst_atomic_int_add (GstAtomicInt * aint, gint val)
gst_atomic_int_add (GstAtomicInt *aint, gint val)
{
volatile int increment, *ptr;
int lock = 1;
@ -294,28 +256,41 @@ gst_atomic_int_add (GstAtomicInt * aint, gint val)
ptr = &(aint->counter);
#if __GNUC__ > 3 || (__GNUC__ >=3 && __GNUC_MINOR__ >= 2)
__asm__ __volatile__ ("1: ldstub [%[ptr] + 3], %[lock]\n" "\torcc %[lock], 0, %[ignore]\n" "\tbne 1b\n" /* go back until we have the lock */
"\tld [%[ptr]], %[inc]\n" "\tsra %[inc], 8, %[inc]\n" "\tadd %[inc], %[val], %[inc]\n" "\tsll %[inc], 8, %[lock]\n" "\tst %[lock],[%[ptr]]\n" /* Release the lock */
:[inc] "=&r" (increment),[lock] "=r" (lock),[ignore] "=&r" (ignore)
:"0" (increment),[ptr] "r" (ptr),[val] "r" (val)
);
__asm__ __volatile__("1: ldstub [%[ptr] + 3], %[lock]\n"
"\torcc %[lock], 0, %[ignore]\n"
"\tbne 1b\n" /* go back until we have the lock */
"\tld [%[ptr]], %[inc]\n"
"\tsra %[inc], 8, %[inc]\n"
"\tadd %[inc], %[val], %[inc]\n"
"\tsll %[inc], 8, %[lock]\n"
"\tst %[lock],[%[ptr]]\n" /* Release the lock */
: [inc] "=&r" (increment), [lock] "=r" (lock),
[ignore] "=&r" (ignore)
: "0" (increment), [ptr] "r" (ptr), [val] "r" (val)
);
#else
__asm__ __volatile__ ("1: ldstub [%4 + 3], %1\n" "\torcc %1, 0, %2\n" "\tbne 1b\n" /* go back until we have the lock */
"\tld [%4], %0\n" "\tsra %0, 8, %0\n" "\tadd %0, %5, %0\n" "\tsll %0, 8, %1\n" "\tst %1,[%4]\n" /* Release the lock */
:"=&r" (increment), "=r" (lock), "=&r" (ignore)
:"0" (increment), "r" (ptr), "r" (val)
);
__asm__ __volatile__("1: ldstub [%4 + 3], %1\n"
"\torcc %1, 0, %2\n"
"\tbne 1b\n" /* go back until we have the lock */
"\tld [%4], %0\n"
"\tsra %0, 8, %0\n"
"\tadd %0, %5, %0\n"
"\tsll %0, 8, %1\n"
"\tst %1,[%4]\n" /* Release the lock */
: "=&r" (increment), "=r" (lock), "=&r" (ignore)
: "0" (increment), "r" (ptr), "r" (val)
);
#endif
}
GST_INLINE_FUNC void
gst_atomic_int_inc (GstAtomicInt * aint)
gst_atomic_int_inc (GstAtomicInt *aint)
{
gst_atomic_int_add (aint, 1);
}
GST_INLINE_FUNC gboolean
gst_atomic_int_dec_and_test (GstAtomicInt * aint)
gst_atomic_int_dec_and_test (GstAtomicInt *aint)
{
volatile int increment, *ptr;
int lock = 1;
@ -324,17 +299,30 @@ gst_atomic_int_dec_and_test (GstAtomicInt * aint)
ptr = &aint->counter;
#if __GNUC__ > 3 || (__GNUC__ >=3 && __GNUC_MINOR__ >= 2)
__asm__ __volatile__ ("1: ldstub [%[ptr] + 3], %[lock]\n" "\torcc %[lock], 0, %[ignore]\n" "\tbne 1b\n" /* go back until we have the lock */
"\tld [%[ptr]], %[inc]\n" "\tsra %[inc], 8, %[inc]\n" "\tsub %[inc], 1, %[inc]\n" "\tsll %[inc], 8, %[lock]\n" "\tst %[lock],[%[ptr]]\n" /* Release the lock */
:[inc] "=&r" (increment),[lock] "=r" (lock),[ignore] "=&r" (ignore)
:"0" (increment),[ptr] "r" (ptr)
);
__asm__ __volatile__("1: ldstub [%[ptr] + 3], %[lock]\n"
"\torcc %[lock], 0, %[ignore]\n"
"\tbne 1b\n" /* go back until we have the lock */
"\tld [%[ptr]], %[inc]\n"
"\tsra %[inc], 8, %[inc]\n"
"\tsub %[inc], 1, %[inc]\n"
"\tsll %[inc], 8, %[lock]\n"
"\tst %[lock],[%[ptr]]\n" /* Release the lock */
: [inc] "=&r" (increment), [lock] "=r" (lock),
[ignore] "=&r" (ignore)
: "0" (increment), [ptr] "r" (ptr)
);
#else
__asm__ __volatile__ ("1: ldstub [%4 + 3], %1\n" "\torcc %1, 0, %2\n" "\tbne 1b\n" /* go back until we have the lock */
"\tld [%4], %0\n" "\tsra %0, 8, %0\n" "\tsub %0, 1, %0\n" "\tsll %0, 8, %1\n" "\tst %1,[%4]\n" /* Release the lock */
:"=&r" (increment), "=r" (lock), "=&r" (ignore)
:"0" (increment), "r" (ptr)
);
__asm__ __volatile__("1: ldstub [%4 + 3], %1\n"
"\torcc %1, 0, %2\n"
"\tbne 1b\n" /* go back until we have the lock */
"\tld [%4], %0\n"
"\tsra %0, 8, %0\n"
"\tsub %0, 1, %0\n"
"\tsll %0, 8, %1\n"
"\tst %1,[%4]\n" /* Release the lock */
: "=&r" (increment), "=r" (lock), "=&r" (ignore)
: "0" (increment), "r" (ptr)
);
#endif
return increment == 0;
@ -344,94 +332,63 @@ gst_atomic_int_dec_and_test (GstAtomicInt * aint)
/* This is disabled because the asm code is broken on most MIPS
* processors and doesn't generally compile. */
#elif defined(HAVE_CPU_MIPS) && defined(__GNUC__) && 0
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC void
gst_atomic_int_destroy (GstAtomicInt * aint)
{
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
{
return aint->counter;
}
GST_INLINE_FUNC void gst_atomic_int_init (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC void gst_atomic_int_destroy (GstAtomicInt *aint) { }
GST_INLINE_FUNC void gst_atomic_int_set (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC gint gst_atomic_int_read (GstAtomicInt *aint) { return aint->counter; }
/* this only works on MIPS II and better */
GST_INLINE_FUNC void
gst_atomic_int_add (GstAtomicInt * aint, gint val)
gst_atomic_int_add (GstAtomicInt *aint, gint val)
{
unsigned long temp;
__asm__ __volatile__ ("1: ll %0, %1 # atomic_add\n"
" addu %0, %2 \n"
" sc %0, %1 \n"
" beqz %0, 1b \n":"=&r" (temp),
"=m" (aint->counter)
:"Ir" (val), "m" (aint->counter));
__asm__ __volatile__(
"1: ll %0, %1 # atomic_add\n"
" addu %0, %2 \n"
" sc %0, %1 \n"
" beqz %0, 1b \n"
: "=&r" (temp), "=m" (aint->counter)
: "Ir" (val), "m" (aint->counter));
}
GST_INLINE_FUNC void
gst_atomic_int_inc (GstAtomicInt * aint)
gst_atomic_int_inc (GstAtomicInt *aint)
{
gst_atomic_int_add (aint, 1);
}
GST_INLINE_FUNC gboolean
gst_atomic_int_dec_and_test (GstAtomicInt * aint)
gst_atomic_int_dec_and_test (GstAtomicInt *aint)
{
unsigned long temp, result;
int val = 1;
__asm__ __volatile__ (".set push \n"
".set noreorder # atomic_sub_return\n"
"1: ll %1, %2 \n"
" subu %0, %1, %3 \n"
" sc %0, %2 \n"
" beqz %0, 1b \n"
" subu %0, %1, %3 \n"
".set pop \n":"=&r" (result),
"=&r" (temp), "=m" (aint->counter)
:"Ir" (val), "m" (aint->counter)
:"memory");
__asm__ __volatile__(
".set push \n"
".set noreorder # atomic_sub_return\n"
"1: ll %1, %2 \n"
" subu %0, %1, %3 \n"
" sc %0, %2 \n"
" beqz %0, 1b \n"
" subu %0, %1, %3 \n"
".set pop \n"
: "=&r" (result), "=&r" (temp), "=m" (aint->counter)
: "Ir" (val), "m" (aint->counter)
: "memory");
return result == 0;
}
/***** S/390 *****/
#elif defined(HAVE_CPU_S390) && defined(__GNUC__)
typedef struct
{
volatile int counter;
}
atomic_t __attribute__ ((aligned (4)));
typedef struct { volatile int counter; } atomic_t __attribute__ ((aligned (4)));
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC void
gst_atomic_int_destroy (GstAtomicInt * aint)
{
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
{
aint->counter = val;
}
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
{
return aint->counter;
}
GST_INLINE_FUNC void gst_atomic_int_init (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC void gst_atomic_int_destroy (GstAtomicInt *aint) { }
GST_INLINE_FUNC void gst_atomic_int_set (GstAtomicInt *aint, gint val) { aint->counter = val; }
GST_INLINE_FUNC gint gst_atomic_int_read (GstAtomicInt *aint) { return aint->counter; }
#define __CS_LOOP(old_val, new_val, ptr, op_val, op_string) \
__asm__ __volatile__(" l %0,0(%3)\n" \
@ -444,50 +401,48 @@ gst_atomic_int_read (GstAtomicInt * aint)
: "a" (ptr), "d" (op_val) : "cc" );
GST_INLINE_FUNC void
gst_atomic_int_add (GstAtomicInt * aint, gint val)
gst_atomic_int_add (GstAtomicInt *aint, gint val)
{
int old_val, new_val;
__CS_LOOP (old_val, new_val, aint, val, "ar");
__CS_LOOP(old_val, new_val, aint, val, "ar");
}
GST_INLINE_FUNC void
gst_atomic_int_inc (GstAtomicInt * aint)
gst_atomic_int_inc (GstAtomicInt *aint)
{
int old_val, new_val;
__CS_LOOP (old_val, new_val, aint, 1, "ar");
__CS_LOOP(old_val, new_val, aint, 1, "ar");
}
GST_INLINE_FUNC gboolean
gst_atomic_int_dec_and_test (GstAtomicInt * aint)
gst_atomic_int_dec_and_test (GstAtomicInt *aint)
{
int old_val, new_val;
__CS_LOOP (old_val, new_val, aint, 1, "sr");
__CS_LOOP(old_val, new_val, aint, 1, "sr");
return new_val == 0;
}
#else
#warning consider putting your architecture specific atomic implementations here
/*
* generic implementation
*/
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt * aint, gint val)
GST_INLINE_FUNC void
gst_atomic_int_init (GstAtomicInt *aint, gint val)
{
aint->counter = val;
aint->lock = g_mutex_new ();
}
GST_INLINE_FUNC void
gst_atomic_int_destroy (GstAtomicInt * aint)
gst_atomic_int_destroy (GstAtomicInt *aint)
{
g_mutex_free (aint->lock);
}
GST_INLINE_FUNC void
gst_atomic_int_set (GstAtomicInt * aint, gint val)
gst_atomic_int_set (GstAtomicInt *aint, gint val)
{
g_mutex_lock (aint->lock);
aint->counter = val;
@ -495,7 +450,7 @@ gst_atomic_int_set (GstAtomicInt * aint, gint val)
}
GST_INLINE_FUNC gint
gst_atomic_int_read (GstAtomicInt * aint)
gst_atomic_int_read (GstAtomicInt *aint)
{
gint res;
@ -507,7 +462,7 @@ gst_atomic_int_read (GstAtomicInt * aint)
}
GST_INLINE_FUNC void
gst_atomic_int_add (GstAtomicInt * aint, gint val)
gst_atomic_int_add (GstAtomicInt *aint, gint val)
{
g_mutex_lock (aint->lock);
aint->counter += val;
@ -515,7 +470,7 @@ gst_atomic_int_add (GstAtomicInt * aint, gint val)
}
GST_INLINE_FUNC void
gst_atomic_int_inc (GstAtomicInt * aint)
gst_atomic_int_inc (GstAtomicInt *aint)
{
g_mutex_lock (aint->lock);
aint->counter++;
@ -523,7 +478,7 @@ gst_atomic_int_inc (GstAtomicInt * aint)
}
GST_INLINE_FUNC gboolean
gst_atomic_int_dec_and_test (GstAtomicInt * aint)
gst_atomic_int_dec_and_test (GstAtomicInt *aint)
{
gboolean res;
@ -539,7 +494,7 @@ gst_atomic_int_dec_and_test (GstAtomicInt * aint)
/*
* common functions
*/
GST_INLINE_FUNC GstAtomicInt *
GST_INLINE_FUNC GstAtomicInt*
gst_atomic_int_new (gint val)
{
GstAtomicInt *aint;
@ -551,13 +506,14 @@ gst_atomic_int_new (gint val)
}
GST_INLINE_FUNC void
gst_atomic_int_free (GstAtomicInt * aint)
gst_atomic_int_free (GstAtomicInt *aint)
{
gst_atomic_int_destroy (aint);
g_free (aint);
}
#endif /* defined (GST_CAN_INLINE) || defined (__GST_TRASH_STACK_C__) */
#endif /* defined (GST_CAN_INLINE) || defined (__GST_TRASH_STACK_C__)*/
G_END_DECLS
#endif /* __GST_ATOMIC_IMPL_H__ */

View file

@ -26,7 +26,9 @@
#include <gst/gstelement.h>
G_BEGIN_DECLS extern GType _gst_bin_type;
G_BEGIN_DECLS
extern GType _gst_bin_type;
#define GST_TYPE_BIN (_gst_bin_type)
#define GST_IS_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BIN))
@ -35,12 +37,11 @@ G_BEGIN_DECLS extern GType _gst_bin_type;
#define GST_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BIN, GstBin))
#define GST_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BIN, GstBinClass))
typedef void (*GstBinPrePostIterateFunction) (GstBin * bin, gpointer user_data);
typedef void (*GstBinPrePostIterateFunction) (GstBin *bin, gpointer user_data);
typedef enum
{
typedef enum {
/* this bin is a manager of child elements, i.e. a pipeline or thread */
GST_BIN_FLAG_MANAGER = GST_ELEMENT_FLAG_LAST,
GST_BIN_FLAG_MANAGER = GST_ELEMENT_FLAG_LAST,
/* this bin iterates itself */
GST_BIN_SELF_SCHEDULABLE,
@ -51,79 +52,81 @@ typedef enum
GST_BIN_FLAG_FIXED_CLOCK,
/* padding */
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5
}
GstBinFlags;
GST_BIN_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 5
} GstBinFlags;
/*typedef struct _GstBin GstBin; */
/*typedef struct _GstBinClass GstBinClass; */
struct _GstBin
{
GstElement element;
struct _GstBin {
GstElement element;
/* our children */
gint numchildren;
GList *children;
gint numchildren;
GList *children;
GstElementState child_states[GST_NUM_STATES];
gpointer _gst_reserved[GST_PADDING];
};
struct _GstBinClass
{
struct _GstBinClass {
GstElementClass parent_class;
/* vtable */
void (*add_element) (GstBin * bin, GstElement * element);
void (*remove_element) (GstBin * bin, GstElement * element);
void (*child_state_change) (GstBin * bin, GstElementState oldstate,
GstElementState newstate, GstElement * element);
void (*add_element) (GstBin *bin, GstElement *element);
void (*remove_element) (GstBin *bin, GstElement *element);
void (*child_state_change) (GstBin *bin, GstElementState oldstate,
GstElementState newstate, GstElement *element);
/* run a full iteration of operation */
gboolean (*iterate) (GstBin * bin);
gboolean (*iterate) (GstBin *bin);
/* signals */
void (*element_added) (GstBin * bin, GstElement * child);
void (*element_removed) (GstBin * bin, GstElement * child);
void (*element_added) (GstBin *bin, GstElement *child);
void (*element_removed) (GstBin *bin, GstElement *child);
gpointer _gst_reserved[GST_PADDING];
};
GType gst_bin_get_type (void);
GstElement *gst_bin_new (const gchar * name);
GType gst_bin_get_type (void);
GstElement* gst_bin_new (const gchar *name);
/* add and remove elements from the bin */
void gst_bin_add (GstBin * bin, GstElement * element);
void gst_bin_add_many (GstBin * bin, GstElement * element_1, ...);
void gst_bin_remove (GstBin * bin, GstElement * element);
void gst_bin_remove_many (GstBin * bin, GstElement * element_1, ...);
void gst_bin_add (GstBin *bin, GstElement *element);
void gst_bin_add_many (GstBin *bin, GstElement *element_1, ...);
void gst_bin_remove (GstBin *bin, GstElement *element);
void gst_bin_remove_many (GstBin *bin, GstElement *element_1, ...);
/* retrieve a single element or the list of children */
GstElement *gst_bin_get_by_name (GstBin * bin, const gchar * name);
GstElement *gst_bin_get_by_name_recurse_up (GstBin * bin, const gchar * name);
G_CONST_RETURN GList *gst_bin_get_list (GstBin * bin);
GstElement *gst_bin_get_by_interface (GstBin * bin, GType interface);
GList *gst_bin_get_all_by_interface (GstBin * bin, GType interface);
GstElement* gst_bin_get_by_name (GstBin *bin, const gchar *name);
GstElement* gst_bin_get_by_name_recurse_up (GstBin *bin, const gchar *name);
G_CONST_RETURN GList*
gst_bin_get_list (GstBin *bin);
GstElement* gst_bin_get_by_interface (GstBin *bin, GType interface);
GList * gst_bin_get_all_by_interface (GstBin *bin, GType interface);
gboolean gst_bin_iterate (GstBin * bin);
gboolean gst_bin_iterate (GstBin *bin);
void gst_bin_use_clock (GstBin * bin, GstClock * clock);
GstClock *gst_bin_get_clock (GstBin * bin);
void gst_bin_auto_clock (GstBin * bin);
void gst_bin_use_clock (GstBin *bin, GstClock *clock);
GstClock* gst_bin_get_clock (GstBin *bin);
void gst_bin_auto_clock (GstBin *bin);
GstElementStateReturn gst_bin_sync_children_state (GstBin * bin);
GstElementStateReturn gst_bin_sync_children_state (GstBin *bin);
/* internal */
/* one of our childs signaled a state change */
void gst_bin_child_state_change (GstBin * bin, GstElementState oldstate,
GstElementState newstate, GstElement * child);
void gst_bin_child_state_change (GstBin *bin, GstElementState oldstate,
GstElementState newstate, GstElement *child);
void gst_bin_set_pre_iterate_function (GstBin * bin,
GstBinPrePostIterateFunction func, gpointer user_data);
void gst_bin_set_post_iterate_function (GstBin * bin,
GstBinPrePostIterateFunction func, gpointer user_data);
void gst_bin_set_pre_iterate_function (GstBin *bin,
GstBinPrePostIterateFunction func,
gpointer user_data);
void gst_bin_set_post_iterate_function (GstBin *bin,
GstBinPrePostIterateFunction func,
gpointer user_data);
G_END_DECLS
#endif /* __GST_BIN_H__ */

View file

@ -27,9 +27,11 @@
#include <gst/gstdata.h>
#include <gst/gstclock.h>
G_BEGIN_DECLS typedef struct _GstBuffer GstBuffer;
G_BEGIN_DECLS
typedef void (*GstBufferFreeDataFunc) (GstBuffer * buffer);
typedef struct _GstBuffer GstBuffer;
typedef void (*GstBufferFreeDataFunc) (GstBuffer *buffer);
#define GST_BUFFER_TRACE_NAME "GstBuffer"
@ -72,30 +74,27 @@ extern GType _gst_buffer_type;
#define GST_BUFFER_OFFSET_END_IS_VALID(buffer) (GST_BUFFER_OFFSET_END (buffer) != GST_BUFFER_OFFSET_NONE)
#define GST_BUFFER_MAXSIZE_IS_VALID(buffer) (GST_BUFFER_MAXSIZE (buffer) != GST_BUFFER_MAXSIZE_NONE)
typedef enum
{
GST_BUFFER_READONLY = GST_DATA_READONLY,
GST_BUFFER_SUBBUFFER = GST_DATA_FLAG_LAST,
typedef enum {
GST_BUFFER_READONLY = GST_DATA_READONLY,
GST_BUFFER_SUBBUFFER = GST_DATA_FLAG_LAST,
GST_BUFFER_ORIGINAL,
GST_BUFFER_DONTFREE,
GST_BUFFER_KEY_UNIT,
GST_BUFFER_DONTKEEP,
GST_BUFFER_FLAG_LAST = GST_DATA_FLAG_LAST + 8
}
GstBufferFlag;
GST_BUFFER_FLAG_LAST = GST_DATA_FLAG_LAST + 8
} GstBufferFlag;
struct _GstBuffer
{
GstData data_type;
struct _GstBuffer {
GstData data_type;
/* pointer to data and its size */
guint8 *data; /* pointer to buffer data */
guint size; /* size of buffer data */
guint maxsize; /* max size of this buffer */
guint8 *data; /* pointer to buffer data */
guint size; /* size of buffer data */
guint maxsize; /* max size of this buffer */
/* timestamp */
GstClockTime timestamp;
GstClockTime duration;
GstClockTime timestamp;
GstClockTime duration;
/* media specific offset
* for video frames, this could be the number of frames,
@ -104,19 +103,19 @@ struct _GstBuffer
* offset_end is the last offset contained in the buffer. The format specifies
* the meaning of both of them exactly.
*/
guint64 offset;
guint64 offset_end;
guint64 offset;
guint64 offset_end;
GstBufferFreeDataFunc free_data;
gpointer buffer_private;
GstBufferFreeDataFunc free_data;
gpointer buffer_private;
gpointer _gst_reserved[GST_PADDING];
};
/* allocation */
GType gst_buffer_get_type (void);
GstBuffer *gst_buffer_new (void);
GstBuffer *gst_buffer_new_and_alloc (guint size);
GType gst_buffer_get_type (void);
GstBuffer* gst_buffer_new (void);
GstBuffer* gst_buffer_new_and_alloc (guint size);
#define gst_buffer_set_data(buf, data, size) \
G_STMT_START { \
@ -129,26 +128,25 @@ G_STMT_START { \
#define gst_buffer_ref_by_count(buf,c) GST_BUFFER (gst_data_ref_by_count (GST_DATA (buf), c))
#define gst_buffer_unref(buf) gst_data_unref (GST_DATA (buf))
/* copy buffer */
void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src);
void gst_buffer_stamp (GstBuffer *dest, const GstBuffer *src);
#define gst_buffer_copy(buf) GST_BUFFER (gst_data_copy (GST_DATA (buf)))
#define gst_buffer_is_writable(buf) gst_data_is_writable (GST_DATA (buf))
#define gst_buffer_copy_on_write(buf) GST_BUFFER (gst_data_copy_on_write (GST_DATA (buf)))
/* creating a subbuffer */
GstBuffer *gst_buffer_create_sub (GstBuffer * parent, guint offset, guint size);
GstBuffer* gst_buffer_create_sub (GstBuffer *parent, guint offset, guint size);
/* merge, span, or append two buffers, intelligently */
GstBuffer *gst_buffer_merge (GstBuffer * buf1, GstBuffer * buf2);
gboolean gst_buffer_is_span_fast (GstBuffer * buf1, GstBuffer * buf2);
GstBuffer *gst_buffer_span (GstBuffer * buf1, guint32 offset, GstBuffer * buf2,
guint32 len);
GstBuffer* gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2);
gboolean gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2);
GstBuffer* gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len);
/* --- private --- */
void _gst_buffer_initialize (void);
void _gst_buffer_initialize (void);
void gst_buffer_default_free (GstBuffer * buffer);
GstBuffer *gst_buffer_default_copy (GstBuffer * buffer);
void gst_buffer_default_free (GstBuffer *buffer);
GstBuffer* gst_buffer_default_copy (GstBuffer *buffer);
G_END_DECLS
#endif /* __GST_BUFFER_H__ */

View file

@ -24,103 +24,119 @@
#include <gst/gststructure.h>
G_BEGIN_DECLS
#define GST_TYPE_CAPS gst_caps_get_type()
#define GST_CAPS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GST_TYPE_CAPS, GstCaps))
#define GST_IS_CAPS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GST_TYPE_CAPS))
#define GST_CAPS_FLAGS_ANY (1 << 0)
#define GST_CAPS_ANY gst_caps_new_any()
#define GST_CAPS_NONE gst_caps_new_empty()
#define GST_STATIC_CAPS_ANY GST_STATIC_CAPS("ANY")
#define GST_STATIC_CAPS_NONE GST_STATIC_CAPS("NONE")
#define GST_CAPS_IS_SIMPLE(caps) (gst_caps_get_size(caps) == 1)
#define gst_caps_is_simple(caps) GST_CAPS_IS_SIMPLE(caps)
#ifndef GST_DISABLE_DEPRECATED
#define GST_DEBUG_CAPS(string, caps) \
GST_DEBUG ( string "%s: " GST_PTR_FORMAT, caps)
#endif
#define GST_STATIC_CAPS(string) \
{ \
/* caps */ { 0 }, \
/* string */ string, \
}
typedef struct _GstCaps GstCaps;
typedef struct _GstStaticCaps GstStaticCaps;
struct _GstCaps
{
struct _GstCaps {
GType type;
guint16 flags;
GPtrArray *structs;
};
struct _GstStaticCaps
{
struct _GstStaticCaps {
GstCaps caps;
const char *string;
};
GType
gst_caps_get_type (void)
G_GNUC_CONST;
GstCaps *gst_caps_new_empty (void);
GstCaps *gst_caps_new_any (void);
GstCaps *gst_caps_new_simple (const char *media_type,
const char *fieldname, ...);
GstCaps *gst_caps_new_full (GstStructure * struct1, ...);
GstCaps *gst_caps_new_full_valist (GstStructure * structure,
va_list var_args);
GstCaps *gst_caps_copy (const GstCaps * caps);
void gst_caps_free (GstCaps * caps);
G_CONST_RETURN GstCaps *gst_static_caps_get (GstStaticCaps * caps);
GType gst_caps_get_type (void) G_GNUC_CONST;
GstCaps * gst_caps_new_empty (void);
GstCaps * gst_caps_new_any (void);
GstCaps * gst_caps_new_simple (const char *media_type,
const char *fieldname,
...);
GstCaps * gst_caps_new_full (GstStructure *struct1,
...);
GstCaps * gst_caps_new_full_valist (GstStructure *structure,
va_list var_args);
GstCaps * gst_caps_copy (const GstCaps *caps);
void gst_caps_free (GstCaps *caps);
G_CONST_RETURN GstCaps * gst_static_caps_get (GstStaticCaps *caps);
/* manipulation */
void gst_caps_append (GstCaps * caps1, GstCaps * caps2);
void gst_caps_append_structure (GstCaps * caps1, GstStructure * structure);
GstCaps *gst_caps_split_one (GstCaps * caps);
int gst_caps_get_size (const GstCaps * caps);
GstStructure *gst_caps_get_structure (const GstCaps * caps, int index);
void gst_caps_append (GstCaps *caps1,
GstCaps *caps2);
void gst_caps_append_structure (GstCaps *caps1,
GstStructure *structure);
GstCaps * gst_caps_split_one (GstCaps *caps);
int gst_caps_get_size (const GstCaps *caps);
GstStructure * gst_caps_get_structure (const GstCaps *caps,
int index);
#ifndef GST_DISABLE_DEPRECATED
GstCaps *gst_caps_copy_1 (const GstCaps * caps);
GstCaps * gst_caps_copy_1 (const GstCaps *caps);
#endif
void gst_caps_set_simple (GstCaps * caps, char *field, ...);
void gst_caps_set_simple_valist (GstCaps * caps,
char *field, va_list varargs);
void gst_caps_set_simple (GstCaps *caps,
char *field, ...);
void gst_caps_set_simple_valist (GstCaps *caps,
char *field,
va_list varargs);
/* tests */
gboolean gst_caps_is_any (const GstCaps * caps);
gboolean gst_caps_is_empty (const GstCaps * caps);
gboolean gst_caps_is_any (const GstCaps *caps);
gboolean gst_caps_is_empty (const GstCaps *caps);
#ifndef GST_DISABLE_DEPRECATED
gboolean gst_caps_is_chained (const GstCaps * caps);
gboolean gst_caps_is_chained (const GstCaps *caps);
#endif
gboolean gst_caps_is_fixed (const GstCaps * caps);
gboolean gst_caps_is_equal_fixed (const GstCaps * caps1,
const GstCaps * caps2);
gboolean gst_caps_is_always_compatible (const GstCaps * caps1,
const GstCaps * caps2);
gboolean gst_caps_is_fixed (const GstCaps *caps);
gboolean gst_caps_is_equal_fixed (const GstCaps *caps1,
const GstCaps *caps2);
gboolean gst_caps_is_always_compatible (const GstCaps *caps1,
const GstCaps *caps2);
/* operations */
GstCaps *gst_caps_intersect (const GstCaps * caps1, const GstCaps * caps2);
GstCaps *gst_caps_union (const GstCaps * caps1, const GstCaps * caps2);
GstCaps *gst_caps_normalize (const GstCaps * caps);
GstCaps *gst_caps_simplify (const GstCaps * caps);
GstCaps * gst_caps_intersect (const GstCaps *caps1,
const GstCaps *caps2);
GstCaps * gst_caps_union (const GstCaps *caps1,
const GstCaps *caps2);
GstCaps * gst_caps_normalize (const GstCaps *caps);
GstCaps * gst_caps_simplify (const GstCaps *caps);
#ifndef GST_DISABLE_LOADSAVE
xmlNodePtr gst_caps_save_thyself (const GstCaps * caps, xmlNodePtr parent);
GstCaps *gst_caps_load_thyself (xmlNodePtr parent);
xmlNodePtr gst_caps_save_thyself (const GstCaps *caps,
xmlNodePtr parent);
GstCaps * gst_caps_load_thyself (xmlNodePtr parent);
#endif
/* utility */
void gst_caps_replace (GstCaps ** caps, GstCaps * newcaps);
gchar *gst_caps_to_string (const GstCaps * caps);
GstCaps *gst_caps_from_string (const gchar * string);
void gst_caps_replace (GstCaps **caps,
GstCaps *newcaps);
gchar * gst_caps_to_string (const GstCaps *caps);
GstCaps * gst_caps_from_string (const gchar *string);
gboolean gst_caps_structure_fixate_field_nearest_int (GstStructure *
structure, const char *field_name, int target);
gboolean gst_caps_structure_fixate_field_nearest_double (GstStructure *
structure, const char *field_name, double target);
gboolean gst_caps_structure_fixate_field_nearest_int (GstStructure *structure,
const char *field_name,
int target);
gboolean gst_caps_structure_fixate_field_nearest_double (GstStructure *structure,
const char *field_name,
double target);
G_END_DECLS
#endif /* __GST_CAPS_H__ */

View file

@ -26,6 +26,7 @@
#include <gst/gstobject.h>
G_BEGIN_DECLS
/* --- standard type macros --- */
#define GST_TYPE_CLOCK (gst_clock_get_type ())
#define GST_CLOCK(clock) (G_TYPE_CHECK_INSTANCE_CAST ((clock), GST_TYPE_CLOCK, GstClock))
@ -33,9 +34,10 @@ G_BEGIN_DECLS
#define GST_CLOCK_CLASS(cclass) (G_TYPE_CHECK_CLASS_CAST ((cclass), GST_TYPE_CLOCK, GstClockClass))
#define GST_IS_CLOCK_CLASS(cclass) (G_TYPE_CHECK_CLASS_TYPE ((cclass), GST_TYPE_CLOCK))
#define GST_CLOCK_GET_CLASS(clock) (G_TYPE_INSTANCE_GET_CLASS ((clock), GST_TYPE_CLOCK, GstClockClass))
typedef guint64 GstClockTime;
typedef gint64 GstClockTimeDiff;
typedef gpointer GstClockID;
typedef guint64 GstClockTime;
typedef gint64 GstClockTimeDiff;
typedef gpointer GstClockID;
#define GST_CLOCK_TIME_NONE ((GstClockTime)-1)
#define GST_CLOCK_TIME_IS_VALID(time) ((time) != GST_CLOCK_TIME_NONE)
@ -55,30 +57,26 @@ G_STMT_START { \
#define GST_CLOCK_ENTRY_TRACE_NAME "GstClockEntry"
typedef struct _GstClockEntry GstClockEntry;
typedef struct _GstClock GstClock;
typedef struct _GstClockClass GstClockClass;
typedef struct _GstClockEntry GstClockEntry;
typedef struct _GstClock GstClock;
typedef struct _GstClockClass GstClockClass;
/* --- prototype for async callbacks --- */
typedef gboolean (*GstClockCallback) (GstClock * clock, GstClockTime time,
GstClockID id, gpointer user_data);
typedef gboolean (*GstClockCallback) (GstClock *clock, GstClockTime time,
GstClockID id, gpointer user_data);
typedef enum
{
typedef enum {
/* --- protected --- */
GST_CLOCK_ENTRY_OK,
GST_CLOCK_ENTRY_EARLY,
GST_CLOCK_ENTRY_RESTART
}
GstClockEntryStatus;
} GstClockEntryStatus;
typedef enum
{
typedef enum {
/* --- protected --- */
GST_CLOCK_ENTRY_SINGLE,
GST_CLOCK_ENTRY_PERIODIC
}
GstClockEntryType;
} GstClockEntryType;
#define GST_CLOCK_ENTRY(entry) ((GstClockEntry *)(entry))
#define GST_CLOCK_ENTRY_CLOCK(entry) ((entry)->clock)
@ -87,120 +85,120 @@ GstClockEntryType;
#define GST_CLOCK_ENTRY_INTERVAL(entry) ((entry)->interval)
#define GST_CLOCK_ENTRY_STATUS(entry) ((entry)->status)
struct _GstClockEntry
{
struct _GstClockEntry {
/* --- protected --- */
GstClock *clock;
GstClockEntryType type;
GstClockTime time;
GstClockTime interval;
GstClockEntryStatus status;
GstClockCallback func;
gpointer user_data;
GstClock *clock;
GstClockEntryType type;
GstClockTime time;
GstClockTime interval;
GstClockEntryStatus status;
GstClockCallback func;
gpointer user_data;
};
typedef enum
{
GST_CLOCK_STOPPED = 0,
GST_CLOCK_TIMEOUT = 1,
GST_CLOCK_EARLY = 2,
GST_CLOCK_ERROR = 3,
GST_CLOCK_UNSUPPORTED = 4
}
GstClockReturn;
GST_CLOCK_STOPPED = 0,
GST_CLOCK_TIMEOUT = 1,
GST_CLOCK_EARLY = 2,
GST_CLOCK_ERROR = 3,
GST_CLOCK_UNSUPPORTED = 4
} GstClockReturn;
typedef enum
{
GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC = (1 << 1),
GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC = (1 << 2),
GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC = (1 << 3),
GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC = (1 << 4),
GST_CLOCK_FLAG_CAN_SET_RESOLUTION = (1 << 5),
GST_CLOCK_FLAG_CAN_SET_SPEED = (1 << 6)
}
GstClockFlags;
GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC = (1 << 1),
GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC = (1 << 2),
GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC = (1 << 3),
GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC = (1 << 4),
GST_CLOCK_FLAG_CAN_SET_RESOLUTION = (1 << 5),
GST_CLOCK_FLAG_CAN_SET_SPEED = (1 << 6)
} GstClockFlags;
#define GST_CLOCK_FLAGS(clock) (GST_CLOCK(clock)->flags)
struct _GstClock
{
GstObject object;
struct _GstClock {
GstObject object;
GstClockFlags flags;
GstClockFlags flags;
/* --- protected --- */
GstClockTime start_time;
GstClockTime last_time;
gint64 max_diff;
GstClockTime start_time;
GstClockTime last_time;
gint64 max_diff;
/* --- private --- */
guint64 resolution;
GList *entries;
GMutex *active_mutex;
GCond *active_cond;
gboolean stats;
guint64 resolution;
GList *entries;
GMutex *active_mutex;
GCond *active_cond;
gboolean stats;
GstClockTime last_event;
GstClockTime max_event_diff;
GstClockTime last_event;
GstClockTime max_event_diff;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstClockClass
{
GstObjectClass parent_class;
struct _GstClockClass {
GstObjectClass parent_class;
/* vtable */
gdouble (*change_speed) (GstClock * clock,
gdouble oldspeed, gdouble newspeed);
gdouble (*get_speed) (GstClock * clock);
guint64 (*change_resolution) (GstClock * clock, guint64 old_resolution,
guint64 new_resolution);
guint64 (*get_resolution) (GstClock * clock);
gdouble (*change_speed) (GstClock *clock,
gdouble oldspeed, gdouble newspeed);
gdouble (*get_speed) (GstClock *clock);
guint64 (*change_resolution) (GstClock *clock, guint64 old_resolution,
guint64 new_resolution);
guint64 (*get_resolution) (GstClock *clock);
GstClockTime (*get_internal_time) (GstClock * clock);
GstClockTime (*get_internal_time) (GstClock *clock);
/* waiting on an ID */
GstClockEntryStatus (*wait) (GstClock * clock, GstClockEntry * entry);
GstClockEntryStatus (*wait_async) (GstClock * clock, GstClockEntry * entry);
void (*unschedule) (GstClock * clock, GstClockEntry * entry);
void (*unlock) (GstClock * clock, GstClockEntry * entry);
GstClockEntryStatus (*wait) (GstClock *clock, GstClockEntry *entry);
GstClockEntryStatus (*wait_async) (GstClock *clock, GstClockEntry *entry);
void (*unschedule) (GstClock *clock, GstClockEntry *entry);
void (*unlock) (GstClock *clock, GstClockEntry *entry);
gpointer _gst_reserved[GST_PADDING];
};
GType gst_clock_get_type (void);
GType gst_clock_get_type (void);
gdouble gst_clock_set_speed (GstClock * clock, gdouble speed);
gdouble gst_clock_get_speed (GstClock * clock);
gdouble gst_clock_set_speed (GstClock *clock, gdouble speed);
gdouble gst_clock_get_speed (GstClock *clock);
guint64 gst_clock_set_resolution (GstClock * clock, guint64 resolution);
guint64 gst_clock_get_resolution (GstClock * clock);
guint64 gst_clock_set_resolution (GstClock *clock, guint64 resolution);
guint64 gst_clock_get_resolution (GstClock *clock);
void gst_clock_set_active (GstClock * clock, gboolean active);
gboolean gst_clock_is_active (GstClock * clock);
void gst_clock_reset (GstClock * clock);
gboolean gst_clock_handle_discont (GstClock * clock, guint64 time);
void gst_clock_set_active (GstClock *clock, gboolean active);
gboolean gst_clock_is_active (GstClock *clock);
void gst_clock_reset (GstClock *clock);
gboolean gst_clock_handle_discont (GstClock *clock, guint64 time);
GstClockTime gst_clock_get_time (GstClock * clock);
GstClockTime gst_clock_get_event_time (GstClock * clock);
GstClockTime gst_clock_get_time (GstClock *clock);
GstClockTime gst_clock_get_event_time (GstClock *clock);
GstClockID gst_clock_get_next_id (GstClock * clock);
GstClockID gst_clock_get_next_id (GstClock *clock);
/* creating IDs that can be used to get notifications */
GstClockID gst_clock_new_single_shot_id (GstClock * clock, GstClockTime time);
GstClockID gst_clock_new_periodic_id (GstClock * clock,
GstClockTime start_time, GstClockTime interval);
GstClockID gst_clock_new_single_shot_id (GstClock *clock,
GstClockTime time);
GstClockID gst_clock_new_periodic_id (GstClock *clock,
GstClockTime start_time,
GstClockTime interval);
/* operations on IDs */
GstClockTime gst_clock_id_get_time (GstClockID id);
GstClockReturn gst_clock_id_wait (GstClockID id, GstClockTimeDiff * jitter);
GstClockReturn gst_clock_id_wait_async (GstClockID id,
GstClockCallback func, gpointer user_data);
void gst_clock_id_unschedule (GstClockID id);
void gst_clock_id_unlock (GstClockID id);
void gst_clock_id_free (GstClockID id);
GstClockTime gst_clock_id_get_time (GstClockID id);
GstClockReturn gst_clock_id_wait (GstClockID id,
GstClockTimeDiff *jitter);
GstClockReturn gst_clock_id_wait_async (GstClockID id,
GstClockCallback func,
gpointer user_data);
void gst_clock_id_unschedule (GstClockID id);
void gst_clock_id_unlock (GstClockID id);
void gst_clock_id_free (GstClockID id);
G_END_DECLS
#endif /* __GST_CLOCK_H__ */

View file

@ -26,8 +26,10 @@
#define __GSTCOMPAT_H__
G_BEGIN_DECLS
#ifndef GST_DISABLE_DEPRECATED
/* 0.5.2 changes */
/* element functions */
#define gst_element_connect(a,b) gst_element_link(a,b)
#define gst_element_connect_pads(a,b,c,d) \
@ -41,6 +43,7 @@ G_BEGIN_DECLS
#define gst_element_connect_filtered(a,b,c) \
gst_element_link_filtered(a,b,c)
#define gst_element_disconnect(a,b) gst_element_unlink(a,b)
/* pad functions */
#define gst_pad_connect(a,b) gst_pad_link(a,b)
#define gst_pad_connect_filtered(a,b,c) gst_pad_link_filtered(a,b,c)
@ -48,17 +51,19 @@ G_BEGIN_DECLS
#define gst_pad_proxy_connect(a,b) gst_pad_proxy_link(a,b)
#define gst_pad_set_connect_function(a,b) \
gst_pad_set_link_function(a,b)
/* pad macros */
#define GST_PAD_IS_CONNECTED(a) GST_PAD_IS_LINKED(a)
/* pad enums */
#define GST_PAD_CONNECT_REFUSED GST_PAD_LINK_REFUSED
#define GST_PAD_CONNECT_DELAYED GST_PAD_LINK_DELAYED
#define GST_PAD_CONNECT_OK GST_PAD_LINK_OK
#define GST_PAD_CONNECT_DONE GST_PAD_LINK_DONE
typedef GstPadLinkReturn GstPadConnectReturn;
typedef GstPadLinkReturn GstPadConnectReturn;
/* pad function types */
typedef GstPadLinkFunction GstPadConnectFunction;
typedef GstPadLinkFunction GstPadConnectFunction;
/* probably not used */
/*
@ -67,4 +72,5 @@ typedef GstPadLinkFunction GstPadConnectFunction;
#endif /* not GST_DISABLE_DEPRECATED */
G_END_DECLS
#endif /* __GSTCOMPAT_H__ */

View file

@ -24,18 +24,19 @@
#ifndef __GST_CPU_H__
#define __GST_CPU_H__
G_BEGIN_DECLS typedef enum
{
GST_CPU_FLAG_MMX = (1 << 0),
GST_CPU_FLAG_SSE = (1 << 1),
GST_CPU_FLAG_MMXEXT = (1 << 2),
GST_CPU_FLAG_3DNOW = (1 << 3)
}
GstCPUFlags;
G_BEGIN_DECLS
void _gst_cpu_initialize (gboolean useopt);
typedef enum {
GST_CPU_FLAG_MMX = (1<<0),
GST_CPU_FLAG_SSE = (1<<1),
GST_CPU_FLAG_MMXEXT = (1<<2),
GST_CPU_FLAG_3DNOW = (1<<3)
} GstCPUFlags;
GstCPUFlags gst_cpu_get_flags (void);
void _gst_cpu_initialize (gboolean useopt);
GstCPUFlags gst_cpu_get_flags (void);
G_END_DECLS
#endif /* __GST_CPU_H__ */

View file

@ -29,30 +29,33 @@
#include <gst/gsttypes.h>
G_BEGIN_DECLS
/* type */
#define GST_DATA(data) ((GstData*)(data))
#define GST_DATA_TYPE(data) (GST_DATA(data)->type)
/* flags */
#define GST_DATA_FLAGS(data) (GST_DATA(data)->flags)
#define GST_DATA_FLAG_SHIFT(flag) (1<<(flag))
#define GST_DATA_FLAG_IS_SET(data,flag) (GST_DATA_FLAGS(data) & (1<<(flag)))
#define GST_DATA_FLAG_SET(data,flag) G_STMT_START{ (GST_DATA_FLAGS(data) |= (1<<(flag))); }G_STMT_END
#define GST_DATA_FLAG_UNSET(data,flag) G_STMT_START{ (GST_DATA_FLAGS(data) &= ~(1<<(flag))); }G_STMT_END
/* Macros for the GType */
#define GST_TYPE_DATA (gst_data_get_type ())
typedef struct _GstData GstData;
typedef void (*GstDataFreeFunction) (GstData * data);
typedef GstData *(*GstDataCopyFunction) (const GstData * data);
typedef void (*GstDataFreeFunction) (GstData *data);
typedef GstData* (*GstDataCopyFunction) (const GstData *data);
typedef enum
{
GST_DATA_READONLY = 1,
GST_DATA_READONLY = 1,
/* insert more */
GST_DATA_FLAG_LAST = 8
}
GstDataFlags;
GST_DATA_FLAG_LAST = 8
} GstDataFlags;
/* refcount */
#define GST_DATA_REFCOUNT(data) ((GST_DATA(data))->refcount)
@ -63,42 +66,41 @@ GstDataFlags;
#define GST_DATA_FREE_FUNC(data) (GST_DATA(data)->free)
struct _GstData
{
GType type;
struct _GstData {
GType type;
/* refcounting */
GstAtomicInt refcount;
GstAtomicInt refcount;
guint16 flags;
guint16 flags;
/* utility function pointers, can override default */
GstDataFreeFunction free; /* free the data */
GstDataCopyFunction copy; /* copy the data */
GstDataFreeFunction free; /* free the data */
GstDataCopyFunction copy; /* copy the data */
gpointer _gst_reserved[GST_PADDING];
};
/* function used by subclasses only */
void gst_data_init (GstData * data, GType type, guint16 flags,
GstDataFreeFunction free, GstDataCopyFunction copy);
void gst_data_dispose (GstData * data);
void gst_data_copy_into (const GstData * data, GstData * target);
void gst_data_init (GstData *data, GType type, guint16 flags,
GstDataFreeFunction free,
GstDataCopyFunction copy);
void gst_data_dispose (GstData *data);
void gst_data_copy_into (const GstData *data, GstData *target);
/* basic operations on data */
GstData *gst_data_copy (const GstData * data);
gboolean gst_data_is_writable (GstData * data);
GstData *gst_data_copy_on_write (GstData * data);
GstData* gst_data_copy (const GstData *data);
gboolean gst_data_is_writable (GstData *data);
GstData* gst_data_copy_on_write (GstData *data);
/* reference counting */
GstData *gst_data_ref (GstData * data);
GstData *gst_data_ref_by_count (GstData * data, gint count);
void gst_data_unref (GstData * data);
GstData* gst_data_ref (GstData* data);
GstData* gst_data_ref_by_count (GstData* data, gint count);
void gst_data_unref (GstData* data);
/* GType for GstData */
GType
gst_data_get_type (void)
G_GNUC_CONST;
GType gst_data_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GST_DATA_H__ */

View file

@ -35,3 +35,4 @@ G_STMT_START { \
G_STMT_START { \
gst_atomic_int_destroy (&(data)->refcount); \
} G_STMT_END;

View file

@ -34,19 +34,19 @@
#include <gst/gstindex.h>
#include <gst/gsttag.h>
G_BEGIN_DECLS typedef struct _GstElementDetails GstElementDetails;
G_BEGIN_DECLS
typedef struct _GstElementDetails GstElementDetails;
/* FIXME: need translatable stuff in here (how handle in registry)? */
struct _GstElementDetails
{
gchar *longname; /* long, english name */
gchar *klass; /* type of element, as hierarchy */
gchar *description; /* insights of one form or another */
gchar *author; /* who wrote this thing? */
struct _GstElementDetails {
gchar *longname; /* long, english name */
gchar *klass; /* type of element, as hierarchy */
gchar *description; /* insights of one form or another */
gchar *author; /* who wrote this thing? */
gpointer _gst_reserved[GST_PADDING];
};
#define GST_ELEMENT_DETAILS(longname,klass,description,author) \
{ longname, klass, description, author, GST_PADDING_INIT }
#define GST_IS_ELEMENT_DETAILS(details) ( \
@ -98,10 +98,9 @@ extern GType _gst_element_type;
#endif
#endif
typedef enum
{
typedef enum {
/* element is complex (for some def.) and generally require a cothread */
GST_ELEMENT_COMPLEX = GST_OBJECT_FLAG_LAST,
GST_ELEMENT_COMPLEX = GST_OBJECT_FLAG_LAST,
/* input and output pads aren't directly coupled to each other
examples: queues, multi-output async readers, etc. */
GST_ELEMENT_DECOUPLED,
@ -128,9 +127,8 @@ typedef enum
GST_ELEMENT_IN_ERROR,
/* use some padding for future expansion */
GST_ELEMENT_FLAG_LAST = GST_OBJECT_FLAG_LAST + 16
}
GstElementFlags;
GST_ELEMENT_FLAG_LAST = GST_OBJECT_FLAG_LAST + 16
} GstElementFlags;
#define GST_ELEMENT_IS_THREAD_SUGGESTED(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_THREAD_SUGGESTED))
#define GST_ELEMENT_IS_EVENT_AWARE(obj) (GST_FLAG_IS_SET(obj,GST_ELEMENT_EVENT_AWARE))
@ -156,124 +154,113 @@ GstElementFlags;
typedef struct _GstElementFactory GstElementFactory;
typedef struct _GstElementFactoryClass GstElementFactoryClass;
typedef void (*GstElementLoopFunction) (GstElement * element);
typedef void (*GstElementPreRunFunction) (GstElement * element);
typedef void (*GstElementPostRunFunction) (GstElement * element);
typedef void (*GstElementLoopFunction) (GstElement *element);
typedef void (*GstElementPreRunFunction) (GstElement *element);
typedef void (*GstElementPostRunFunction) (GstElement *element);
struct _GstElement
{
GstObject object;
struct _GstElement {
GstObject object;
/* element state and scheduling */
guint8 current_state;
guint8 pending_state;
guint8 current_state;
guint8 pending_state;
GstElementLoopFunction loopfunc;
GstScheduler *sched;
gpointer sched_private;
GstScheduler *sched;
gpointer sched_private;
/* allocated clock */
GstClock *clock;
GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
GstClock *clock;
GstClockTimeDiff base_time; /* NULL/READY: 0 - PAUSED: current time - PLAYING: difference to clock */
/* element pads */
guint16 numpads;
guint16 numsrcpads;
guint16 numsinkpads;
GList *pads;
guint16 numpads;
guint16 numsrcpads;
guint16 numsinkpads;
GList *pads;
GMutex *state_mutex;
GCond *state_cond;
GMutex *state_mutex;
GCond *state_cond;
GstElementPreRunFunction pre_run_func;
GstElementPreRunFunction pre_run_func;
GstElementPostRunFunction post_run_func;
GAsyncQueue *prop_value_queue;
GMutex *property_mutex;
GAsyncQueue *prop_value_queue;
GMutex *property_mutex;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementClass
{
GstObjectClass parent_class;
struct _GstElementClass {
GstObjectClass parent_class;
/* the element details */
GstElementDetails details;
GstElementDetails details;
/* factory that the element was created from */
GstElementFactory *elementfactory;
GstElementFactory *elementfactory;
/* templates for our pads */
GList *padtemplates;
gint numpadtemplates;
GList *padtemplates;
gint numpadtemplates;
/* signal callbacks */
void (*state_change) (GstElement * element, GstElementState old,
GstElementState state);
void (*new_pad) (GstElement * element, GstPad * pad);
void (*pad_removed) (GstElement * element, GstPad * pad);
void (*error) (GstElement * element, GstElement * source, GError * error,
gchar * debug);
void (*eos) (GstElement * element);
void (*found_tag) (GstElement * element, GstElement * source,
const GstTagList * tag_list);
void (*state_change) (GstElement *element, GstElementState old, GstElementState state);
void (*new_pad) (GstElement *element, GstPad *pad);
void (*pad_removed) (GstElement *element, GstPad *pad);
void (*error) (GstElement *element, GstElement *source, GError *error, gchar *debug);
void (*eos) (GstElement *element);
void (*found_tag) (GstElement *element, GstElement *source, const GstTagList *tag_list);
/* local pointers for get/set */
void (*set_property) (GObject * object, guint prop_id, const GValue * value,
GParamSpec * pspec);
void (*get_property) (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec);
void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
void (*get_property) (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
/* vtable */
gboolean (*release_locks) (GstElement * element);
/* vtable*/
gboolean (*release_locks) (GstElement *element);
/* query/convert/events functions */
const GstEventMask *(*get_event_masks) (GstElement * element);
gboolean (*send_event) (GstElement * element, GstEvent * event);
const GstFormat *(*get_formats) (GstElement * element);
gboolean (*convert) (GstElement * element,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
const GstQueryType *(*get_query_types) (GstElement * element);
gboolean (*query) (GstElement * element, GstQueryType type,
GstFormat * format, gint64 * value);
const GstEventMask* (*get_event_masks) (GstElement *element);
gboolean (*send_event) (GstElement *element, GstEvent *event);
const GstFormat* (*get_formats) (GstElement *element);
gboolean (*convert) (GstElement *element,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
const GstQueryType* (*get_query_types) (GstElement *element);
gboolean (*query) (GstElement *element, GstQueryType type,
GstFormat *format, gint64 *value);
/* change the element state */
GstElementStateReturn (*change_state) (GstElement * element);
GstElementStateReturn (*change_state) (GstElement *element);
/* request/release pads */
GstPad *(*request_new_pad) (GstElement * element, GstPadTemplate * templ,
const gchar * name);
void (*release_pad) (GstElement * element, GstPad * pad);
GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ, const gchar* name);
void (*release_pad) (GstElement *element, GstPad *pad);
/* set/get clocks */
GstClock *(*get_clock) (GstElement * element);
void (*set_clock) (GstElement * element, GstClock * clock);
GstClock* (*get_clock) (GstElement *element);
void (*set_clock) (GstElement *element, GstClock *clock);
/* index */
GstIndex *(*get_index) (GstElement * element);
void (*set_index) (GstElement * element, GstIndex * index);
GstIndex* (*get_index) (GstElement *element);
void (*set_index) (GstElement *element, GstIndex *index);
GstElementStateReturn (*set_state) (GstElement * element,
GstElementState state);
GstElementStateReturn (*set_state) (GstElement *element, GstElementState state);
gpointer _gst_reserved[GST_PADDING];
};
void gst_element_class_add_pad_template (GstElementClass * klass,
GstPadTemplate * templ);
void gst_element_class_install_std_props (GstElementClass * klass,
const gchar * first_name, ...);
void gst_element_class_set_details (GstElementClass * klass,
const GstElementDetails * details);
void gst_element_class_add_pad_template (GstElementClass *klass, GstPadTemplate *templ);
void gst_element_class_install_std_props (GstElementClass *klass,
const gchar *first_name, ...);
void gst_element_class_set_details (GstElementClass *klass,
const GstElementDetails *details);
#define gst_element_default_deep_notify gst_object_default_deep_notify
void gst_element_default_error (GObject * object, GstObject * orig,
GError * error, gchar * debug);
void gst_element_default_error (GObject *object, GstObject *orig, GError *error, gchar *debug);
GType gst_element_get_type (void);
void gst_element_set_loop_function (GstElement * element,
GstElementLoopFunction loop);
GType gst_element_get_type (void);
void gst_element_set_loop_function (GstElement *element,
GstElementLoopFunction loop);
#define gst_element_get_name(elem) gst_object_get_name(GST_OBJECT(elem))
#define gst_element_set_name(elem,name) gst_object_set_name(GST_OBJECT(elem),name)
@ -281,129 +268,125 @@ void gst_element_set_loop_function (GstElement * element,
#define gst_element_set_parent(elem,parent) gst_object_set_parent(GST_OBJECT(elem),parent)
/* threadsafe versions of their g_object_* counterparts */
void gst_element_set (GstElement * element, const gchar * first_property_name,
...);
void gst_element_get (GstElement * element, const gchar * first_property_name,
...);
void gst_element_set_valist (GstElement * element,
const gchar * first_property_name, va_list var_args);
void gst_element_get_valist (GstElement * element,
const gchar * first_property_name, va_list var_args);
void gst_element_set_property (GstElement * element,
const gchar * property_name, const GValue * value);
void gst_element_get_property (GstElement * element,
const gchar * property_name, GValue * value);
void gst_element_set (GstElement *element, const gchar *first_property_name, ...);
void gst_element_get (GstElement *element, const gchar *first_property_name, ...);
void gst_element_set_valist (GstElement *element, const gchar *first_property_name,
va_list var_args);
void gst_element_get_valist (GstElement *element, const gchar *first_property_name,
va_list var_args);
void gst_element_set_property (GstElement *element, const gchar *property_name,
const GValue *value);
void gst_element_get_property (GstElement *element, const gchar *property_name,
GValue *value);
void gst_element_enable_threadsafe_properties (GstElement * element);
void gst_element_disable_threadsafe_properties (GstElement * element);
void gst_element_set_pending_properties (GstElement * element);
void gst_element_enable_threadsafe_properties (GstElement *element);
void gst_element_disable_threadsafe_properties (GstElement *element);
void gst_element_set_pending_properties (GstElement *element);
/* clocking */
gboolean gst_element_requires_clock (GstElement * element);
gboolean gst_element_provides_clock (GstElement * element);
GstClock *gst_element_get_clock (GstElement * element);
void gst_element_set_clock (GstElement * element, GstClock * clock);
GstClockReturn gst_element_clock_wait (GstElement * element,
GstClockID id, GstClockTimeDiff * jitter);
GstClockTime gst_element_get_time (GstElement * element);
gboolean gst_element_wait (GstElement * element, GstClockTime timestamp);
void gst_element_set_time (GstElement * element, GstClockTime time);
void gst_element_adjust_time (GstElement * element, GstClockTimeDiff diff);
gboolean gst_element_requires_clock (GstElement *element);
gboolean gst_element_provides_clock (GstElement *element);
GstClock* gst_element_get_clock (GstElement *element);
void gst_element_set_clock (GstElement *element, GstClock *clock);
GstClockReturn gst_element_clock_wait (GstElement *element,
GstClockID id, GstClockTimeDiff *jitter);
GstClockTime gst_element_get_time (GstElement *element);
gboolean gst_element_wait (GstElement *element, GstClockTime timestamp);
void gst_element_set_time (GstElement *element, GstClockTime time);
void gst_element_adjust_time (GstElement *element, GstClockTimeDiff diff);
/* indexs */
gboolean gst_element_is_indexable (GstElement * element);
void gst_element_set_index (GstElement * element, GstIndex * index);
GstIndex *gst_element_get_index (GstElement * element);
gboolean gst_element_is_indexable (GstElement *element);
void gst_element_set_index (GstElement *element, GstIndex *index);
GstIndex* gst_element_get_index (GstElement *element);
gboolean gst_element_release_locks (GstElement * element);
gboolean gst_element_release_locks (GstElement *element);
void gst_element_yield (GstElement * element);
gboolean gst_element_interrupt (GstElement * element);
void gst_element_set_scheduler (GstElement * element, GstScheduler * sched);
GstScheduler *gst_element_get_scheduler (GstElement * element);
void gst_element_yield (GstElement *element);
gboolean gst_element_interrupt (GstElement *element);
void gst_element_set_scheduler (GstElement *element, GstScheduler *sched);
GstScheduler* gst_element_get_scheduler (GstElement *element);
void gst_element_add_pad (GstElement * element, GstPad * pad);
void gst_element_remove_pad (GstElement * element, GstPad * pad);
GstPad *gst_element_add_ghost_pad (GstElement * element, GstPad * pad,
const gchar * name);
void gst_element_remove_ghost_pad (GstElement * element, GstPad * pad);
void gst_element_add_pad (GstElement *element, GstPad *pad);
void gst_element_remove_pad (GstElement *element, GstPad *pad);
GstPad * gst_element_add_ghost_pad (GstElement *element, GstPad *pad, const gchar *name);
void gst_element_remove_ghost_pad (GstElement *element, GstPad *pad);
GstPad *gst_element_get_pad (GstElement * element, const gchar * name);
GstPad *gst_element_get_static_pad (GstElement * element, const gchar * name);
GstPad *gst_element_get_request_pad (GstElement * element, const gchar * name);
void gst_element_release_request_pad (GstElement * element, GstPad * pad);
GstPad* gst_element_get_pad (GstElement *element, const gchar *name);
GstPad* gst_element_get_static_pad (GstElement *element, const gchar *name);
GstPad* gst_element_get_request_pad (GstElement *element, const gchar *name);
void gst_element_release_request_pad (GstElement *element, GstPad *pad);
G_CONST_RETURN GList *gst_element_get_pad_list (GstElement * element);
GstPad *gst_element_get_compatible_pad (GstElement * element, GstPad * pad);
GstPad *gst_element_get_compatible_pad_filtered (GstElement * element,
GstPad * pad, const GstCaps * filtercaps);
G_CONST_RETURN GList*
gst_element_get_pad_list (GstElement *element);
GstPad* gst_element_get_compatible_pad (GstElement *element, GstPad *pad);
GstPad* gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad,
const GstCaps *filtercaps);
GstPadTemplate *gst_element_class_get_pad_template (GstElementClass *
element_class, const gchar * name);
GList *gst_element_class_get_pad_template_list (GstElementClass *
element_class);
GstPadTemplate *gst_element_get_pad_template (GstElement * element,
const gchar * name);
GList *gst_element_get_pad_template_list (GstElement * element);
GstPadTemplate *gst_element_get_compatible_pad_template (GstElement * element,
GstPadTemplate * compattempl);
GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name);
GList* gst_element_class_get_pad_template_list (GstElementClass *element_class);
GstPadTemplate* gst_element_get_pad_template (GstElement *element, const gchar *name);
GList* gst_element_get_pad_template_list (GstElement *element);
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
gboolean gst_element_link (GstElement * src, GstElement * dest);
gboolean gst_element_link_many (GstElement * element_1,
GstElement * element_2, ...);
gboolean gst_element_link_filtered (GstElement * src, GstElement * dest,
const GstCaps * filtercaps);
void gst_element_unlink (GstElement * src, GstElement * dest);
void gst_element_unlink_many (GstElement * element_1,
GstElement * element_2, ...);
gboolean gst_element_link (GstElement *src, GstElement *dest);
gboolean gst_element_link_many (GstElement *element_1,
GstElement *element_2, ...);
gboolean gst_element_link_filtered (GstElement *src, GstElement *dest,
const GstCaps *filtercaps);
void gst_element_unlink (GstElement *src, GstElement *dest);
void gst_element_unlink_many (GstElement *element_1,
GstElement *element_2, ...);
gboolean gst_element_link_pads (GstElement * src, const gchar * srcpadname,
GstElement * dest, const gchar * destpadname);
gboolean gst_element_link_pads_filtered (GstElement * src,
const gchar * srcpadname, GstElement * dest, const gchar * destpadname,
const GstCaps * filtercaps);
void gst_element_unlink_pads (GstElement * src, const gchar * srcpadname,
GstElement * dest, const gchar * destpadname);
gboolean gst_element_link_pads (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
gboolean gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname,
const GstCaps *filtercaps);
void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
G_CONST_RETURN GstEventMask *gst_element_get_event_masks (GstElement * element);
gboolean gst_element_send_event (GstElement * element, GstEvent * event);
gboolean gst_element_seek (GstElement * element, GstSeekType seek_type,
guint64 offset);
G_CONST_RETURN GstQueryType *gst_element_get_query_types (GstElement * element);
gboolean gst_element_query (GstElement * element, GstQueryType type,
GstFormat * format, gint64 * value);
G_CONST_RETURN GstFormat *gst_element_get_formats (GstElement * element);
gboolean gst_element_convert (GstElement * element,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
G_CONST_RETURN GstEventMask*
gst_element_get_event_masks (GstElement *element);
gboolean gst_element_send_event (GstElement *element, GstEvent *event);
gboolean gst_element_seek (GstElement *element, GstSeekType seek_type,
guint64 offset);
G_CONST_RETURN GstQueryType*
gst_element_get_query_types (GstElement *element);
gboolean gst_element_query (GstElement *element, GstQueryType type,
GstFormat *format, gint64 *value);
G_CONST_RETURN GstFormat*
gst_element_get_formats (GstElement *element);
gboolean gst_element_convert (GstElement *element,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
void gst_element_found_tags (GstElement * element, const GstTagList * tag_list);
void gst_element_found_tags_for_pad (GstElement * element, GstPad * pad,
GstClockTime timestamp, GstTagList * list);
void gst_element_found_tags (GstElement *element, const GstTagList *tag_list);
void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstClockTime timestamp,
GstTagList *list);
void gst_element_set_eos (GstElement * element);
void gst_element_set_eos (GstElement *element);
gchar *_gst_element_error_printf (const gchar * format, ...);
void gst_element_error_full (GstElement * element, GQuark domain, gint code,
gchar * message, gchar * debug,
const gchar * file, const gchar * function, gint line);
gchar * _gst_element_error_printf (const gchar *format, ...);
void gst_element_error_full (GstElement *element, GQuark domain, gint code,
gchar *message, gchar *debug,
const gchar *file, const gchar *function, gint line);
gboolean gst_element_is_locked_state (GstElement * element);
void gst_element_set_locked_state (GstElement * element, gboolean locked_state);
gboolean gst_element_sync_state_with_parent (GstElement * element);
gboolean gst_element_is_locked_state (GstElement *element);
void gst_element_set_locked_state (GstElement *element, gboolean locked_state);
gboolean gst_element_sync_state_with_parent (GstElement *element);
GstElementState gst_element_get_state (GstElement * element);
GstElementStateReturn gst_element_set_state (GstElement * element,
GstElementState state);
GstElementState gst_element_get_state (GstElement *element);
GstElementStateReturn gst_element_set_state (GstElement *element, GstElementState state);
void gst_element_wait_state_change (GstElement * element);
void gst_element_wait_state_change (GstElement *element);
G_CONST_RETURN gchar *gst_element_state_get_name (GstElementState state);
G_CONST_RETURN gchar* gst_element_state_get_name (GstElementState state);
GstElementFactory *gst_element_get_factory (GstElement * element);
GstElementFactory* gst_element_get_factory (GstElement *element);
GstBin *gst_element_get_managing_bin (GstElement * element);
GstBin* gst_element_get_managing_bin (GstElement *element);
/*
@ -420,69 +403,66 @@ GstBin *gst_element_get_managing_bin (GstElement * element);
#define GST_IS_ELEMENT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ELEMENT_FACTORY))
#define GST_IS_ELEMENT_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ELEMENT_FACTORY))
struct _GstElementFactory
{
GstPluginFeature parent;
struct _GstElementFactory {
GstPluginFeature parent;
GType type; /* unique GType of element or 0 if not loaded */
GType type; /* unique GType of element or 0 if not loaded */
GstElementDetails details;
GstElementDetails details;
GList *padtemplates;
guint numpadtemplates;
GList * padtemplates;
guint numpadtemplates;
/* URI interface stuff */
guint uri_type;
gchar **uri_protocols;
guint uri_type;
gchar ** uri_protocols;
GList *interfaces; /* interfaces this element implements */
GList * interfaces; /* interfaces this element implements */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstElementFactoryClass
{
struct _GstElementFactoryClass {
GstPluginFeatureClass parent_class;
gpointer _gst_reserved[GST_PADDING];
};
GType gst_element_factory_get_type (void);
GType gst_element_factory_get_type (void);
gboolean gst_element_register (GstPlugin * plugin,
const gchar * elementname, guint rank, GType type);
gboolean gst_element_register (GstPlugin *plugin,
const gchar *elementname,
guint rank,
GType type);
GstElementFactory *gst_element_factory_find (const gchar * name);
GType gst_element_factory_get_element_type (GstElementFactory * factory);
G_CONST_RETURN gchar *gst_element_factory_get_longname (GstElementFactory *
factory);
G_CONST_RETURN gchar *gst_element_factory_get_klass (GstElementFactory *
factory);
G_CONST_RETURN gchar *gst_element_factory_get_description (GstElementFactory *
factory);
G_CONST_RETURN gchar *gst_element_factory_get_author (GstElementFactory *
factory);
guint gst_element_factory_get_num_pad_templates (GstElementFactory * factory);
G_CONST_RETURN GList *gst_element_factory_get_pad_templates (GstElementFactory *
factory);
guint gst_element_factory_get_uri_type (GstElementFactory * factory);
gchar **gst_element_factory_get_uri_protocols (GstElementFactory * factory);
GstElementFactory * gst_element_factory_find (const gchar *name);
GType gst_element_factory_get_element_type (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_longname (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory);
guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
G_CONST_RETURN GList * gst_element_factory_get_pad_templates (GstElementFactory *factory);
guint gst_element_factory_get_uri_type (GstElementFactory *factory);
gchar ** gst_element_factory_get_uri_protocols (GstElementFactory *factory);
GstElement *gst_element_factory_create (GstElementFactory * factory,
const gchar * name);
GstElement *gst_element_factory_make (const gchar * factoryname,
const gchar * name);
GstElement* gst_element_factory_create (GstElementFactory *factory,
const gchar *name);
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
gboolean gst_element_factory_can_src_caps (GstElementFactory * factory,
const GstCaps * caps);
gboolean gst_element_factory_can_sink_caps (GstElementFactory * factory,
const GstCaps * caps);
gboolean gst_element_factory_can_src_caps (GstElementFactory *factory,
const GstCaps *caps);
gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory,
const GstCaps *caps);
void __gst_element_factory_add_pad_template (GstElementFactory * elementfactory,
GstPadTemplate * templ);
void __gst_element_factory_add_interface (GstElementFactory * elementfactory,
const gchar * interfacename);
void __gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
GstPadTemplate *templ);
void __gst_element_factory_add_interface (GstElementFactory *elementfactory,
const gchar *interfacename);
G_END_DECLS
#endif /* __GST_ELEMENT_H__ */

View file

@ -21,6 +21,7 @@
#define __GST_ERROR_H__
G_BEGIN_DECLS
/*
* we define FIXME error domains:
* GST_CORE_ERROR
@ -30,12 +31,12 @@ G_BEGIN_DECLS
*
* Check GError API docs for rationale for naming.
*/
/* Core errors are anything that can go wrong in or using
* the core GStreamer library */
/* FIXME: should we divide in numerical blocks so we can easily add
for example PAD errors later ? */
typedef enum
{
typedef enum {
GST_CORE_ERROR_FAILED = 1,
GST_CORE_ERROR_TOO_LAZY,
GST_CORE_ERROR_NOT_IMPLEMENTED,
@ -54,8 +55,7 @@ GstCoreError;
/* Library errors are for errors from the library being used by elements
initializing, closing, ... */
typedef enum
{
typedef enum {
GST_LIBRARY_ERROR_FAILED = 1,
GST_LIBRARY_ERROR_TOO_LAZY,
GST_LIBRARY_ERROR_INIT,
@ -69,8 +69,7 @@ GstLibraryError;
/* Resource errors are for anything external used by an element:
memory, files, network connections, process space, ...
They're typically used by source and sink elements */
typedef enum
{
typedef enum {
GST_RESOURCE_ERROR_FAILED = 1,
GST_RESOURCE_ERROR_TOO_LAZY,
GST_RESOURCE_ERROR_NOT_FOUND,
@ -91,8 +90,7 @@ GstResourceError;
/* Stream errors are for anything related to the stream being processed:
format errors, media type errors, ...
They're typically used by decoders, demuxers, converters, ... */
typedef enum
{
typedef enum {
GST_STREAM_ERROR_FAILED = 1,
GST_STREAM_ERROR_TOO_LAZY,
GST_STREAM_ERROR_NOT_IMPLEMENTED,
@ -118,12 +116,15 @@ GstStreamError;
#define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno))
GType gst_g_error_get_type (void);
gchar *gst_error_get_message (GQuark domain, gint code);
GQuark gst_stream_error_quark (void);
GQuark gst_core_error_quark (void);
GQuark gst_resource_error_quark (void);
GQuark gst_library_error_quark (void);
GType gst_g_error_get_type (void);
gchar * gst_error_get_message (GQuark domain, gint code);
GQuark gst_stream_error_quark (void);
GQuark gst_core_error_quark (void);
GQuark gst_resource_error_quark (void);
GQuark gst_library_error_quark (void);
G_END_DECLS
#endif /* __GST_ERROR_H__ */

View file

@ -30,29 +30,29 @@
#include <gst/gstobject.h>
#include <gst/gststructure.h>
G_BEGIN_DECLS extern GType _gst_event_type;
G_BEGIN_DECLS
typedef enum
{
GST_EVENT_UNKNOWN = 0,
GST_EVENT_EOS = 1,
GST_EVENT_FLUSH = 2,
GST_EVENT_EMPTY = 3,
GST_EVENT_DISCONTINUOUS = 4,
/*GST_EVENT_NEW_MEDIA = 5, <- removed */
GST_EVENT_QOS = 6,
GST_EVENT_SEEK = 7,
GST_EVENT_SEEK_SEGMENT = 8,
GST_EVENT_SEGMENT_DONE = 9,
GST_EVENT_SIZE = 10,
GST_EVENT_RATE = 11,
GST_EVENT_FILLER = 12,
GST_EVENT_TS_OFFSET = 13,
GST_EVENT_INTERRUPT = 14,
GST_EVENT_NAVIGATION = 15,
GST_EVENT_TAG = 16
}
GstEventType;
extern GType _gst_event_type;
typedef enum {
GST_EVENT_UNKNOWN = 0,
GST_EVENT_EOS = 1,
GST_EVENT_FLUSH = 2,
GST_EVENT_EMPTY = 3,
GST_EVENT_DISCONTINUOUS = 4,
/*GST_EVENT_NEW_MEDIA = 5, <- removed */
GST_EVENT_QOS = 6,
GST_EVENT_SEEK = 7,
GST_EVENT_SEEK_SEGMENT = 8,
GST_EVENT_SEGMENT_DONE = 9,
GST_EVENT_SIZE = 10,
GST_EVENT_RATE = 11,
GST_EVENT_FILLER = 12,
GST_EVENT_TS_OFFSET = 13,
GST_EVENT_INTERRUPT = 14,
GST_EVENT_NAVIGATION = 15,
GST_EVENT_TAG = 16
} GstEventType;
#define GST_EVENT_TRACE_NAME "GstEvent"
@ -73,21 +73,18 @@ GstEventType;
#define GST_SEEK_METHOD_MASK 0x000f0000
#define GST_SEEK_FLAGS_MASK 0xfff00000
typedef enum
{
GST_EVENT_FLAG_NONE = 0,
typedef enum {
GST_EVENT_FLAG_NONE = 0,
/* indicates negative rates are supported */
GST_RATE_FLAG_NEGATIVE = (1 << 1)
}
GstEventFlag;
GST_RATE_FLAG_NEGATIVE = (1 << 1)
} GstEventFlag;
typedef struct
{
GstEventType type;
GstEventFlag flags;
}
GstEventMask;
GstEventType type;
GstEventFlag flags;
} GstEventMask;
#ifndef GST_DISABLE_DEPRECATED
#ifdef G_HAVE_ISO_VARARGS
@ -116,37 +113,32 @@ functionname (type pad) \
#endif
/* seek events, extends GstEventFlag */
typedef enum
{
typedef enum {
/* | with some format */
/* | with one of these */
GST_SEEK_METHOD_CUR = (1 << (GST_SEEK_METHOD_SHIFT + 0)),
GST_SEEK_METHOD_SET = (1 << (GST_SEEK_METHOD_SHIFT + 1)),
GST_SEEK_METHOD_END = (1 << (GST_SEEK_METHOD_SHIFT + 2)),
GST_SEEK_METHOD_CUR = (1 << (GST_SEEK_METHOD_SHIFT + 0)),
GST_SEEK_METHOD_SET = (1 << (GST_SEEK_METHOD_SHIFT + 1)),
GST_SEEK_METHOD_END = (1 << (GST_SEEK_METHOD_SHIFT + 2)),
/* | with optional seek flags */
/* seek flags */
GST_SEEK_FLAG_FLUSH = (1 << (GST_SEEK_FLAGS_SHIFT + 0)),
GST_SEEK_FLAG_ACCURATE = (1 << (GST_SEEK_FLAGS_SHIFT + 1)),
GST_SEEK_FLAG_KEY_UNIT = (1 << (GST_SEEK_FLAGS_SHIFT + 2)),
GST_SEEK_FLAG_SEGMENT_LOOP = (1 << (GST_SEEK_FLAGS_SHIFT + 3))
GST_SEEK_FLAG_FLUSH = (1 << (GST_SEEK_FLAGS_SHIFT + 0)),
GST_SEEK_FLAG_ACCURATE = (1 << (GST_SEEK_FLAGS_SHIFT + 1)),
GST_SEEK_FLAG_KEY_UNIT = (1 << (GST_SEEK_FLAGS_SHIFT + 2)),
GST_SEEK_FLAG_SEGMENT_LOOP = (1 << (GST_SEEK_FLAGS_SHIFT + 3))
}
GstSeekType;
} GstSeekType;
typedef enum
{
typedef enum {
GST_SEEK_CERTAIN,
GST_SEEK_FUZZY
}
GstSeekAccuracy;
} GstSeekAccuracy;
typedef struct
{
GstFormat format;
gint64 value;
}
GstFormatValue;
GstFormat format;
gint64 value;
} GstFormatValue;
#define GST_EVENT_SEEK_TYPE(event) (GST_EVENT(event)->event_data.seek.type)
#define GST_EVENT_SEEK_FORMAT(event) (GST_EVENT_SEEK_TYPE(event) & GST_SEEK_FORMAT_MASK)
@ -165,57 +157,44 @@ GstFormatValue;
#define GST_EVENT_RATE_VALUE(event) (GST_EVENT(event)->event_data.rate.value)
struct _GstEvent
{
struct _GstEvent {
GstData data;
GstEventType type;
guint64 timestamp;
GstObject *src;
GstEventType type;
guint64 timestamp;
GstObject *src;
union
{
struct
{
GstSeekType type;
gint64 offset;
gint64 endoffset;
GstSeekAccuracy accuracy;
}
seek;
struct
{
GstFormatValue offsets[8];
gint noffsets;
gboolean new_media;
}
discont;
struct
{
GstFormat format;
gint64 value;
}
size;
struct
{
gdouble value;
}
rate;
struct
{
GstStructure *structure;
}
structure;
}
event_data;
union {
struct {
GstSeekType type;
gint64 offset;
gint64 endoffset;
GstSeekAccuracy accuracy;
} seek;
struct {
GstFormatValue offsets[8];
gint noffsets;
gboolean new_media;
} discont;
struct {
GstFormat format;
gint64 value;
} size;
struct {
gdouble value;
} rate;
struct {
GstStructure *structure;
} structure;
} event_data;
gpointer _gst_reserved[GST_PADDING];
};
void _gst_event_initialize (void);
void _gst_event_initialize (void);
GType gst_event_get_type (void);
GstEvent *gst_event_new (GstEventType type);
GType gst_event_get_type (void);
GstEvent* gst_event_new (GstEventType type);
/* refcounting */
#define gst_event_ref(ev) GST_EVENT (gst_data_ref (GST_DATA (ev)))
@ -224,26 +203,24 @@ GstEvent *gst_event_new (GstEventType type);
/* copy buffer */
#define gst_event_copy(ev) GST_EVENT (gst_data_copy (GST_DATA (ev)))
gboolean gst_event_masks_contains (const GstEventMask * masks,
GstEventMask * mask);
gboolean gst_event_masks_contains (const GstEventMask *masks, GstEventMask *mask);
/* seek event */
GstEvent *gst_event_new_seek (GstSeekType type, gint64 offset);
GstEvent* gst_event_new_seek (GstSeekType type, gint64 offset);
GstEvent *gst_event_new_segment_seek (GstSeekType type, gint64 start,
gint64 stop);
GstEvent* gst_event_new_segment_seek (GstSeekType type, gint64 start, gint64 stop);
/* size events */
GstEvent *gst_event_new_size (GstFormat format, gint64 value);
GstEvent* gst_event_new_size (GstFormat format, gint64 value);
/* discontinous event */
GstEvent *gst_event_new_discontinuous (gboolean new_media,
GstFormat format1, ...);
GstEvent *gst_event_new_discontinuous_valist (gboolean new_media,
GstFormat format1, va_list var_args);
gboolean gst_event_discont_get_value (GstEvent * event, GstFormat format,
gint64 * value);
GstEvent* gst_event_new_discontinuous (gboolean new_media,
GstFormat format1, ...);
GstEvent* gst_event_new_discontinuous_valist (gboolean new_media,
GstFormat format1,
va_list var_args);
gboolean gst_event_discont_get_value (GstEvent *event, GstFormat format, gint64 *value);
#define gst_event_new_filler() gst_event_new(GST_EVENT_FILLER)
@ -251,4 +228,5 @@ gboolean gst_event_discont_get_value (GstEvent * event, GstFormat format,
#define gst_event_new_flush() gst_event_new(GST_EVENT_FLUSH)
G_END_DECLS
#endif /* __GST_EVENT_H__ */

View file

@ -23,10 +23,11 @@
#include <glib.h>
G_BEGIN_DECLS
typedef gboolean (*GstFilterFunc) (gpointer obj, gpointer user_data);
GList *gst_filter_run (const GList * list, GstFilterFunc func, gboolean first,
gpointer user_data);
typedef gboolean (*GstFilterFunc) (gpointer obj, gpointer user_data);
GList* gst_filter_run (const GList *list, GstFilterFunc func, gboolean first, gpointer user_data);
G_END_DECLS
#endif /* __GST_FILTER_H_ */

View file

@ -27,16 +27,16 @@
#include <glib.h>
G_BEGIN_DECLS typedef enum
{
GST_FORMAT_UNDEFINED = 0, /* must be first in list */
GST_FORMAT_DEFAULT = 1, /* samples for audio, frames/fields for video */
GST_FORMAT_BYTES = 2,
GST_FORMAT_TIME = 3,
GST_FORMAT_BUFFERS = 4,
GST_FORMAT_PERCENT = 5
}
GstFormat;
G_BEGIN_DECLS
typedef enum {
GST_FORMAT_UNDEFINED = 0, /* must be first in list */
GST_FORMAT_DEFAULT = 1, /* samples for audio, frames/fields for video */
GST_FORMAT_BYTES = 2,
GST_FORMAT_TIME = 3,
GST_FORMAT_BUFFERS = 4,
GST_FORMAT_PERCENT = 5
} GstFormat;
/* a percentage is always relative to 1000000 */
#define GST_FORMAT_PERCENT_MAX G_GINT64_CONSTANT (1000000)
@ -46,9 +46,9 @@ typedef struct _GstFormatDefinition GstFormatDefinition;
struct _GstFormatDefinition
{
GstFormat value;
gchar *nick;
gchar *description;
GstFormat value;
gchar *nick;
gchar *description;
};
#ifdef G_HAVE_ISO_VARARGS
@ -75,18 +75,22 @@ functionname (type object) \
}
#endif
void _gst_format_initialize (void);
void _gst_format_initialize (void);
/* register a new format */
GstFormat gst_format_register (const gchar * nick, const gchar * description);
GstFormat gst_format_get_by_nick (const gchar * nick);
GstFormat gst_format_register (const gchar *nick,
const gchar *description);
GstFormat gst_format_get_by_nick (const gchar *nick);
/* check if a format is in an array of formats */
gboolean gst_formats_contains (const GstFormat * formats, GstFormat format);
gboolean gst_formats_contains (const GstFormat *formats, GstFormat format);
/* query for format details */
G_CONST_RETURN GstFormatDefinition *gst_format_get_details (GstFormat format);
G_CONST_RETURN GList *gst_format_get_definitions (void);
G_CONST_RETURN GstFormatDefinition*
gst_format_get_details (GstFormat format);
G_CONST_RETURN GList*
gst_format_get_definitions (void);
G_END_DECLS
#endif /* __GST_FORMAT_H__ */

View file

@ -29,42 +29,39 @@
#include <gst/gstpluginfeature.h>
G_BEGIN_DECLS
#define GST_TYPE_INDEX (gst_index_get_type ())
#define GST_INDEX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_INDEX, GstIndex))
#define GST_IS_INDEX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_INDEX))
#define GST_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_INDEX, GstIndexClass))
#define GST_IS_INDEX_CLASS(klass) (GST_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_INDEX))
#define GST_INDEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_INDEX, GstIndexClass))
#define GST_TYPE_INDEX_ENTRY (gst_index_entry_get_type())
typedef struct _GstIndexEntry GstIndexEntry;
typedef struct _GstIndexGroup GstIndexGroup;
typedef struct _GstIndex GstIndex;
typedef struct _GstIndexClass GstIndexClass;
typedef enum
{
typedef enum {
GST_INDEX_UNKNOWN,
GST_INDEX_CERTAIN,
GST_INDEX_FUZZY
}
GstIndexCertainty;
} GstIndexCertainty;
typedef enum
{
typedef enum {
GST_INDEX_ENTRY_ID,
GST_INDEX_ENTRY_ASSOCIATION,
GST_INDEX_ENTRY_OBJECT,
GST_INDEX_ENTRY_FORMAT
}
GstIndexEntryType;
} GstIndexEntryType;
typedef enum
{
typedef enum {
GST_INDEX_LOOKUP_EXACT,
GST_INDEX_LOOKUP_BEFORE,
GST_INDEX_LOOKUP_AFTER
}
GstIndexLookupMethod;
} GstIndexLookupMethod;
#define GST_INDEX_NASSOCS(entry) ((entry)->data.assoc.nassocs)
#define GST_INDEX_ASSOC_FLAGS(entry) ((entry)->data.assoc.flags)
@ -73,21 +70,18 @@ GstIndexLookupMethod;
typedef struct _GstIndexAssociation GstIndexAssociation;
struct _GstIndexAssociation
{
GstFormat format;
gint64 value;
struct _GstIndexAssociation {
GstFormat format;
gint64 value;
};
typedef enum
{
GST_ASSOCIATION_FLAG_NONE = 0,
typedef enum {
GST_ASSOCIATION_FLAG_NONE = 0,
GST_ASSOCIATION_FLAG_KEY_UNIT = (1 << 0),
/* new flags should start here */
GST_ASSOCIATION_FLAG_LAST = (1 << 8)
}
GstAssocFlags;
GST_ASSOCIATION_FLAG_LAST = (1 << 8)
} GstAssocFlags;
#define GST_INDEX_FORMAT_FORMAT(entry) ((entry)->data.format.format)
#define GST_INDEX_FORMAT_KEY(entry) ((entry)->data.format.key)
@ -96,44 +90,33 @@ GstAssocFlags;
#define GST_INDEX_ID_DESCRIPTION(entry) ((entry)->data.id.description)
struct _GstIndexEntry
{
GstIndexEntryType type;
gint id;
struct _GstIndexEntry {
GstIndexEntryType type;
gint id;
union
{
struct
{
gchar *description;
}
id;
struct
{
gint nassocs;
GstIndexAssociation * assocs;
GstAssocFlags flags;
}
assoc;
struct
{
gchar *key;
GType type;
gpointer object;
}
object;
struct
{
GstFormat format;
gchar *key;
}
format;
}
data;
union {
struct {
gchar *description;
} id;
struct {
gint nassocs;
GstIndexAssociation
*assocs;
GstAssocFlags flags;
} assoc;
struct {
gchar *key;
GType type;
gpointer object;
} object;
struct {
GstFormat format;
gchar *key;
} format;
} data;
};
struct _GstIndexGroup
{
struct _GstIndexGroup {
/* unique ID of group in index */
gint groupnum;
@ -147,114 +130,112 @@ struct _GstIndexGroup
gint peergroup;
};
typedef gboolean (*GstIndexFilter) (GstIndex * index, GstIndexEntry * entry);
typedef gboolean (*GstIndexFilter) (GstIndex *index,
GstIndexEntry *entry);
typedef enum
{
typedef enum {
GST_INDEX_RESOLVER_CUSTOM,
GST_INDEX_RESOLVER_GTYPE,
GST_INDEX_RESOLVER_PATH
}
GstIndexResolverMethod;
} GstIndexResolverMethod;
typedef gboolean (*GstIndexResolver) (GstIndex * index,
GstObject * writer, gchar ** writer_string, gpointer user_data);
typedef enum
{
GST_INDEX_WRITABLE = GST_OBJECT_FLAG_LAST,
typedef gboolean (*GstIndexResolver) (GstIndex *index,
GstObject *writer,
gchar **writer_string,
gpointer user_data);
typedef enum {
GST_INDEX_WRITABLE = GST_OBJECT_FLAG_LAST,
GST_INDEX_READABLE,
GST_INDEX_FLAG_LAST = GST_OBJECT_FLAG_LAST + 8
}
GstIndexFlags;
GST_INDEX_FLAG_LAST = GST_OBJECT_FLAG_LAST + 8
} GstIndexFlags;
#define GST_INDEX_IS_READABLE(obj) (GST_FLAG_IS_SET (obj, GST_INDEX_READABLE))
#define GST_INDEX_IS_WRITABLE(obj) (GST_FLAG_IS_SET (obj, GST_INDEX_WRITABLE))
struct _GstIndex
{
GstObject object;
struct _GstIndex {
GstObject object;
GList *groups;
GstIndexGroup *curgroup;
gint maxgroup;
GList *groups;
GstIndexGroup *curgroup;
gint maxgroup;
GstIndexResolverMethod method;
GstIndexResolver resolver;
gpointer resolver_user_data;
GstIndexResolver resolver;
gpointer resolver_user_data;
GstIndexFilter filter;
gpointer filter_user_data;
GstIndexFilter filter;
gpointer filter_user_data;
GHashTable *writers;
gint last_id;
GHashTable *writers;
gint last_id;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstIndexClass
{
struct _GstIndexClass {
GstObjectClass parent_class;
gboolean (*get_writer_id) (GstIndex * index, gint * writer_id,
gchar * writer_string);
gboolean (*get_writer_id) (GstIndex *index, gint *writer_id, gchar *writer_string);
void (*commit) (GstIndex * index, gint id);
void (*commit) (GstIndex *index, gint id);
/* abstract methods */
void (*add_entry) (GstIndex * index, GstIndexEntry * entry);
void (*add_entry) (GstIndex *index, GstIndexEntry *entry);
GstIndexEntry *(*get_assoc_entry) (GstIndex * index, gint id,
GstIndexLookupMethod method, GstAssocFlags flags,
GstFormat format, gint64 value,
GCompareDataFunc func, gpointer user_data);
GstIndexEntry* (*get_assoc_entry) (GstIndex *index, gint id,
GstIndexLookupMethod method, GstAssocFlags flags,
GstFormat format, gint64 value,
GCompareDataFunc func,
gpointer user_data);
/* signals */
void (*entry_added) (GstIndex * index, GstIndexEntry * entry);
void (*entry_added) (GstIndex *index, GstIndexEntry *entry);
gpointer _gst_reserved[GST_PADDING];
};
GType gst_index_get_type (void);
GstIndex *gst_index_new (void);
void gst_index_commit (GstIndex * index, gint id);
GType gst_index_get_type (void);
GstIndex* gst_index_new (void);
void gst_index_commit (GstIndex *index, gint id);
gint gst_index_get_group (GstIndex * index);
gint gst_index_new_group (GstIndex * index);
gboolean gst_index_set_group (GstIndex * index, gint groupnum);
gint gst_index_get_group (GstIndex *index);
gint gst_index_new_group (GstIndex *index);
gboolean gst_index_set_group (GstIndex *index, gint groupnum);
void gst_index_set_certainty (GstIndex * index, GstIndexCertainty certainty);
GstIndexCertainty gst_index_get_certainty (GstIndex * index);
void gst_index_set_certainty (GstIndex *index,
GstIndexCertainty certainty);
GstIndexCertainty gst_index_get_certainty (GstIndex *index);
void gst_index_set_filter (GstIndex * index,
GstIndexFilter filter, gpointer user_data);
void gst_index_set_resolver (GstIndex * index,
GstIndexResolver resolver, gpointer user_data);
void gst_index_set_filter (GstIndex *index,
GstIndexFilter filter, gpointer user_data);
void gst_index_set_resolver (GstIndex *index,
GstIndexResolver resolver, gpointer user_data);
gboolean gst_index_get_writer_id (GstIndex * index, GstObject * writer,
gint * id);
gboolean gst_index_get_writer_id (GstIndex *index, GstObject *writer, gint *id);
GstIndexEntry *gst_index_add_format (GstIndex * index, gint id,
GstFormat format);
GstIndexEntry *gst_index_add_association (GstIndex * index, gint id,
GstAssocFlags flags, GstFormat format, gint64 value, ...);
GstIndexEntry *gst_index_add_object (GstIndex * index, gint id, gchar * key,
GType type, gpointer object);
GstIndexEntry *gst_index_add_id (GstIndex * index, gint id,
gchar * description);
GstIndexEntry* gst_index_add_format (GstIndex *index, gint id, GstFormat format);
GstIndexEntry* gst_index_add_association (GstIndex *index, gint id, GstAssocFlags flags,
GstFormat format, gint64 value, ...);
GstIndexEntry* gst_index_add_object (GstIndex *index, gint id, gchar *key,
GType type, gpointer object);
GstIndexEntry* gst_index_add_id (GstIndex *index, gint id,
gchar *description);
GstIndexEntry *gst_index_get_assoc_entry (GstIndex * index, gint id,
GstIndexLookupMethod method, GstAssocFlags flags,
GstFormat format, gint64 value);
GstIndexEntry *gst_index_get_assoc_entry_full (GstIndex * index, gint id,
GstIndexLookupMethod method, GstAssocFlags flags,
GstFormat format, gint64 value, GCompareDataFunc func, gpointer user_data);
GstIndexEntry* gst_index_get_assoc_entry (GstIndex *index, gint id,
GstIndexLookupMethod method, GstAssocFlags flags,
GstFormat format, gint64 value);
GstIndexEntry* gst_index_get_assoc_entry_full (GstIndex *index, gint id,
GstIndexLookupMethod method, GstAssocFlags flags,
GstFormat format, gint64 value,
GCompareDataFunc func,
gpointer user_data);
/* working with index entries */
GType gst_index_entry_get_type (void);
GstIndexEntry *gst_index_entry_copy (GstIndexEntry * entry);
void gst_index_entry_free (GstIndexEntry * entry);
gboolean gst_index_entry_assoc_map (GstIndexEntry * entry,
GstFormat format, gint64 * value);
GstIndexEntry * gst_index_entry_copy (GstIndexEntry *entry);
void gst_index_entry_free (GstIndexEntry *entry);
gboolean gst_index_entry_assoc_map (GstIndexEntry *entry,
GstFormat format, gint64 *value);
/*
* creating indexs
*
@ -269,33 +250,32 @@ gboolean gst_index_entry_assoc_map (GstIndexEntry * entry,
typedef struct _GstIndexFactory GstIndexFactory;
typedef struct _GstIndexFactoryClass GstIndexFactoryClass;
struct _GstIndexFactory
{
struct _GstIndexFactory {
GstPluginFeature feature;
gchar *longdesc; /* long description of the index (well, don't overdo it..) */
GType type; /* unique GType of the index */
gchar *longdesc; /* long description of the index (well, don't overdo it..) */
GType type; /* unique GType of the index */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstIndexFactoryClass
{
struct _GstIndexFactoryClass {
GstPluginFeatureClass parent;
gpointer _gst_reserved[GST_PADDING];
};
GType gst_index_factory_get_type (void);
GType gst_index_factory_get_type (void);
GstIndexFactory *gst_index_factory_new (const gchar * name,
const gchar * longdesc, GType type);
void gst_index_factory_destroy (GstIndexFactory * factory);
GstIndexFactory* gst_index_factory_new (const gchar *name,
const gchar *longdesc, GType type);
void gst_index_factory_destroy (GstIndexFactory *factory);
GstIndexFactory *gst_index_factory_find (const gchar * name);
GstIndexFactory* gst_index_factory_find (const gchar *name);
GstIndex *gst_index_factory_create (GstIndexFactory * factory);
GstIndex *gst_index_factory_make (const gchar * name);
GstIndex* gst_index_factory_create (GstIndexFactory *factory);
GstIndex* gst_index_factory_make (const gchar *name);
G_END_DECLS
#endif /* __GST_INDEX_H__ */

View file

@ -31,15 +31,16 @@
#include <gst/gstconfig.h>
G_BEGIN_DECLS
/*
* GStreamer's debugging subsystem is an easy way to get information about what
* the application is doing.
* It is not meant for programming errors. Use GLibs methods (g_warning and so
* on for that.
*/
/* log levels */
typedef enum
{
typedef enum {
GST_LEVEL_NONE = 0,
GST_LEVEL_ERROR,
GST_LEVEL_WARNING,
@ -48,8 +49,7 @@ G_BEGIN_DECLS
GST_LEVEL_LOG,
/* add more */
GST_LEVEL_COUNT
}
GstDebugLevel;
} GstDebugLevel;
/* we can now override this to be more general in maintainer builds or cvs checkouts */
#ifndef GST_LEVEL_DEFAULT
@ -64,45 +64,42 @@ GstDebugLevel;
* Background color codes:
* 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
*/
typedef enum
{
typedef enum {
/* colors */
GST_DEBUG_FG_BLACK = 0x0000,
GST_DEBUG_FG_RED = 0x0001,
GST_DEBUG_FG_GREEN = 0x0002,
GST_DEBUG_FG_YELLOW = 0x0003,
GST_DEBUG_FG_BLUE = 0x0004,
GST_DEBUG_FG_MAGENTA = 0x0005,
GST_DEBUG_FG_CYAN = 0x0006,
GST_DEBUG_FG_WHITE = 0x0007,
GST_DEBUG_FG_BLACK = 0x0000,
GST_DEBUG_FG_RED = 0x0001,
GST_DEBUG_FG_GREEN = 0x0002,
GST_DEBUG_FG_YELLOW = 0x0003,
GST_DEBUG_FG_BLUE = 0x0004,
GST_DEBUG_FG_MAGENTA = 0x0005,
GST_DEBUG_FG_CYAN = 0x0006,
GST_DEBUG_FG_WHITE = 0x0007,
/* background colors */
GST_DEBUG_BG_BLACK = 0x0000,
GST_DEBUG_BG_RED = 0x0010,
GST_DEBUG_BG_GREEN = 0x0020,
GST_DEBUG_BG_YELLOW = 0x0030,
GST_DEBUG_BG_BLUE = 0x0040,
GST_DEBUG_BG_MAGENTA = 0x0050,
GST_DEBUG_BG_CYAN = 0x0060,
GST_DEBUG_BG_WHITE = 0x0070,
GST_DEBUG_BG_BLACK = 0x0000,
GST_DEBUG_BG_RED = 0x0010,
GST_DEBUG_BG_GREEN = 0x0020,
GST_DEBUG_BG_YELLOW = 0x0030,
GST_DEBUG_BG_BLUE = 0x0040,
GST_DEBUG_BG_MAGENTA = 0x0050,
GST_DEBUG_BG_CYAN = 0x0060,
GST_DEBUG_BG_WHITE = 0x0070,
/* other formats */
GST_DEBUG_BOLD = 0x0100,
GST_DEBUG_UNDERLINE = 0x0200
}
GstDebugColorFlags;
GST_DEBUG_BOLD = 0x0100,
GST_DEBUG_UNDERLINE = 0x0200
} GstDebugColorFlags;
#define GST_DEBUG_FG_MASK (0x000F)
#define GST_DEBUG_BG_MASK (0x00F0)
#define GST_DEBUG_FORMAT_MASK (0xFF00)
typedef struct _GstDebugCategory GstDebugCategory;
struct _GstDebugCategory
{
/*< private > */
GstAtomicInt *threshold;
guint color; /* see defines above */
struct _GstDebugCategory {
/*< private >*/
GstAtomicInt * threshold;
guint color; /* see defines above */
const gchar *name;
const gchar *description;
const gchar * name;
const gchar * description;
};
/********** some convenience macros for debugging **********/
@ -130,11 +127,14 @@ struct _GstDebugCategory
typedef struct _GstDebugMessage GstDebugMessage;
typedef void (*GstLogFunction) (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line, GObject * object, GstDebugMessage * message, gpointer data);
typedef void (*GstLogFunction) (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
GstDebugMessage * message,
gpointer data);
/* Disable this subsystem if no varargs macro can be found.
Use a trick so the core builds the functions nonetheless if it wasn't
@ -150,51 +150,57 @@ typedef void (*GstLogFunction) (GstDebugCategory * category,
#ifndef __GST_DISABLE_GST_DEBUG
void _gst_debug_init (void);
void _gst_debug_init (void);
/* note we can't use G_GNUC_PRINTF (7, 8) because gcc chokes on %P, which
* we use for GST_PTR_FORMAT. */
void
gst_debug_log (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line, GObject * object, const gchar * format, ...)
G_GNUC_NO_INSTRUMENT;
void gst_debug_log_valist (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object, const gchar * format, va_list args) G_GNUC_NO_INSTRUMENT;
void gst_debug_log (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
const gchar * format,
...) G_GNUC_NO_INSTRUMENT;
void gst_debug_log_valist (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
const gchar * format,
va_list args) G_GNUC_NO_INSTRUMENT;
const gchar *gst_debug_message_get (GstDebugMessage * message);
const gchar * gst_debug_message_get (GstDebugMessage * message);
void gst_debug_log_default (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
GstDebugMessage * message, gpointer unused) G_GNUC_NO_INSTRUMENT;
void gst_debug_log_default (GstDebugCategory * category,
GstDebugLevel level,
const gchar * file,
const gchar * function,
gint line,
GObject * object,
GstDebugMessage * message,
gpointer unused) G_GNUC_NO_INSTRUMENT;
G_CONST_RETURN gchar *gst_debug_level_get_name (GstDebugLevel level);
G_CONST_RETURN gchar *
gst_debug_level_get_name (GstDebugLevel level);
void gst_debug_add_log_function (GstLogFunction func, gpointer data);
guint gst_debug_remove_log_function (GstLogFunction func);
guint gst_debug_remove_log_function_by_data (gpointer data);
void gst_debug_add_log_function (GstLogFunction func,
gpointer data);
guint gst_debug_remove_log_function (GstLogFunction func);
guint gst_debug_remove_log_function_by_data (gpointer data);
void gst_debug_set_active (gboolean active);
gboolean gst_debug_is_active (void);
void gst_debug_set_active (gboolean active);
gboolean gst_debug_is_active (void);
void gst_debug_set_colored (gboolean colored);
gboolean gst_debug_is_colored (void);
void gst_debug_set_colored (gboolean colored);
gboolean gst_debug_is_colored (void);
void gst_debug_set_default_threshold (GstDebugLevel level);
GstDebugLevel gst_debug_get_default_threshold (void);
void gst_debug_set_threshold_for_name (const gchar * name,
GstDebugLevel level);
void gst_debug_unset_threshold_for_name (const gchar * name);
void gst_debug_set_default_threshold (GstDebugLevel level);
GstDebugLevel gst_debug_get_default_threshold (void);
void gst_debug_set_threshold_for_name (const gchar * name,
GstDebugLevel level);
void gst_debug_unset_threshold_for_name (const gchar * name);
/**
* GST_DEBUG_CATEGORY:
@ -221,8 +227,9 @@ gst_debug_log (GstDebugCategory * category,
*/
#define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
/* do not use this function, use the macros below */
GstDebugCategory *_gst_debug_category_new (gchar * name,
guint color, gchar * description);
GstDebugCategory *_gst_debug_category_new (gchar * name,
guint color,
gchar * description);
/**
* GST_DEBUG_CATEGORY_INIT:
* @cat: the category to initialize.
@ -263,27 +270,24 @@ gst_debug_log (GstDebugCategory * category,
cat = _gst_debug_category_new (name,color,description); \
}G_STMT_END
void gst_debug_category_free (GstDebugCategory * category);
void gst_debug_category_set_threshold (GstDebugCategory * category,
GstDebugLevel level);
void gst_debug_category_reset_threshold (GstDebugCategory * category);
GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory *
category);
G_CONST_RETURN gchar *gst_debug_category_get_name (GstDebugCategory *
category);
guint gst_debug_category_get_color (GstDebugCategory * category);
G_CONST_RETURN gchar *gst_debug_category_get_description (GstDebugCategory
* category);
GSList *gst_debug_get_all_categories (void);
void gst_debug_category_free (GstDebugCategory * category);
void gst_debug_category_set_threshold (GstDebugCategory * category,
GstDebugLevel level);
void gst_debug_category_reset_threshold (GstDebugCategory * category);
GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category);
G_CONST_RETURN gchar *
gst_debug_category_get_name (GstDebugCategory * category);
guint gst_debug_category_get_color (GstDebugCategory * category);
G_CONST_RETURN gchar *
gst_debug_category_get_description (GstDebugCategory * category);
GSList * gst_debug_get_all_categories (void);
gchar *gst_debug_construct_term_color (guint colorinfo);
gchar * gst_debug_construct_term_color (guint colorinfo);
extern GstDebugCategory *GST_CAT_DEFAULT;
extern GstDebugCategory * GST_CAT_DEFAULT;
/* this symbol may not be used */
extern gboolean __gst_debug_enabled;
extern gboolean __gst_debug_enabled;
#ifdef G_HAVE_ISO_VARARGS
#define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
if (__gst_debug_enabled) { \
@ -382,8 +386,10 @@ gst_debug_log (GstDebugCategory * category,
/********** function pointer stuff **********/
void *_gst_debug_register_funcptr (void *ptr, gchar * ptrname);
G_CONST_RETURN gchar *_gst_debug_nameof_funcptr (void *ptr);
void* _gst_debug_register_funcptr (void * ptr,
gchar * ptrname);
G_CONST_RETURN gchar*
_gst_debug_nameof_funcptr (void * ptr);
#define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void *)(ptr), #ptr) , ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)
@ -397,34 +403,34 @@ gst_debug_log (GstDebugCategory * category,
# pragma GCC poison _gst_debug_category_new
#endif
#define _gst_debug_init() /* NOP */
#define _gst_debug_init() /* NOP */
#define gst_debug_set_log_function(func,data) /* NOP */
#define gst_debug_reset_log_function(void) /* NOP */
#define gst_debug_set_default_threshold(level) /* NOP */
#define gst_debug_set_log_function(func,data) /* NOP */
#define gst_debug_reset_log_function(void) /* NOP */
#define gst_debug_set_default_threshold(level) /* NOP */
#define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
#define gst_debug_category_set_threshold_for_name(name, level) /* NOP */
#define gst_debug_category_unset_threshold_for_name(name) /* NOP */
#define gst_debug_category_set_threshold_for_name(name, level) /* NOP */
#define gst_debug_category_unset_threshold_for_name(name) /* NOP */
#define gst_debug_level_get_name(level) ("NONE")
#define gst_debug_add_log_function(func,data) (FALSE)
#define gst_debug_remove_log_function(func) (0)
#define gst_debug_remove_log_function_by_data(data) (0)
#define gst_debug_set_active(active) /* NOP */
#define gst_debug_set_active(active) /* NOP */
#define gst_debug_is_active() (FALSE)
#define gst_debug_set_colored(colored) /* NOP */
#define gst_debug_set_colored(colored) /* NOP */
#define gst_debug_is_colored() (FALSE)
#define gst_debug_set_default_threshold(level) /* NOP */
#define gst_debug_set_default_threshold(level) /* NOP */
#define gst_debug_get_default_threshold() (GST_LEVEL_NONE)
#define gst_debug_set_threshold_for_name(name,level) /* NOP */
#define gst_debug_unset_threshold_for_name(name) /* NOP */
#define GST_DEBUG_CATEGORY(var) /* NOP */
#define GST_DEBUG_CATEGORY_EXTERN(var) /* NOP */
#define GST_DEBUG_CATEGORY_STATIC(var) /* NOP */
#define GST_DEBUG_CATEGORY(var) /* NOP */
#define GST_DEBUG_CATEGORY_EXTERN(var) /* NOP */
#define GST_DEBUG_CATEGORY_STATIC(var) /* NOP */
#define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) /* NOP */
#define gst_debug_category_free(category) /* NOP */
#define gst_debug_category_set_threshold(category,level) /* NOP */
#define gst_debug_category_free(category) /* NOP */
#define gst_debug_category_set_threshold(category,level) /* NOP */
#define gst_debug_category_reset_threshold(category) /* NOP */
#define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
#define gst_debug_category_get_name(cat) ("")
@ -435,76 +441,76 @@ gst_debug_log (GstDebugCategory * category,
#ifdef G_HAVE_ISO_VARARGS
#define GST_CAT_LEVEL_LOG(cat,level,...) /* NOP */
#define GST_CAT_LEVEL_LOG(cat,level,...) /* NOP */
#define GST_CAT_ERROR_OBJECT(...) /* NOP */
#define GST_CAT_WARNING_OBJECT(...) /* NOP */
#define GST_CAT_INFO_OBJECT(...) /* NOP */
#define GST_CAT_DEBUG_OBJECT(...) /* NOP */
#define GST_CAT_LOG_OBJECT(...) /* NOP */
#define GST_CAT_ERROR_OBJECT(...) /* NOP */
#define GST_CAT_WARNING_OBJECT(...) /* NOP */
#define GST_CAT_INFO_OBJECT(...) /* NOP */
#define GST_CAT_DEBUG_OBJECT(...) /* NOP */
#define GST_CAT_LOG_OBJECT(...) /* NOP */
#define GST_CAT_ERROR(...) /* NOP */
#define GST_CAT_WARNING(...) /* NOP */
#define GST_CAT_INFO(...) /* NOP */
#define GST_CAT_DEBUG(...) /* NOP */
#define GST_CAT_LOG(...) /* NOP */
#define GST_CAT_ERROR(...) /* NOP */
#define GST_CAT_WARNING(...) /* NOP */
#define GST_CAT_INFO(...) /* NOP */
#define GST_CAT_DEBUG(...) /* NOP */
#define GST_CAT_LOG(...) /* NOP */
#define GST_ERROR_OBJECT(...) /* NOP */
#define GST_WARNING_OBJECT(...) /* NOP */
#define GST_INFO_OBJECT(...) /* NOP */
#define GST_DEBUG_OBJECT(...) /* NOP */
#define GST_LOG_OBJECT(...) /* NOP */
#define GST_ERROR_OBJECT(...) /* NOP */
#define GST_WARNING_OBJECT(...) /* NOP */
#define GST_INFO_OBJECT(...) /* NOP */
#define GST_DEBUG_OBJECT(...) /* NOP */
#define GST_LOG_OBJECT(...) /* NOP */
#define GST_ERROR(...) /* NOP */
#define GST_WARNING(...) /* NOP */
#define GST_INFO(...) /* NOP */
#define GST_DEBUG(...) /* NOP */
#define GST_LOG(...) /* NOP */
#define GST_ERROR(...) /* NOP */
#define GST_WARNING(...) /* NOP */
#define GST_INFO(...) /* NOP */
#define GST_DEBUG(...) /* NOP */
#define GST_LOG(...) /* NOP */
#ifdef GST_DEBUG_ENABLE_DEPRECATED
#define GST_INFO_ELEMENT(cat,obj,...) /* NOP */
#define GST_DEBUG_ELEMENT(cat,obj,...) /* NOP */
#define GST_DEBUG_ENTER(...) /* NOP */
#define GST_DEBUG_LEAVE(...) /* NOP */
#define GST_INFO_ENTER(...) /* NOP */
#define GST_INFO_LEAVE(...) /* NOP */
#define GST_INFO_ELEMENT(cat,obj,...) /* NOP */
#define GST_DEBUG_ELEMENT(cat,obj,...) /* NOP */
#define GST_DEBUG_ENTER(...) /* NOP */
#define GST_DEBUG_LEAVE(...) /* NOP */
#define GST_INFO_ENTER(...) /* NOP */
#define GST_INFO_LEAVE(...) /* NOP */
#endif /* GST_DEBUG_ENABLE_DEPRECATED */
#else /* !G_HAVE_ISO_VARARGS */
#define GST_CAT_LEVEL_LOG(cat,level,args...) /* NOP */
#define GST_CAT_LEVEL_LOG(cat,level,args...) /* NOP */
#define GST_CAT_ERROR_OBJECT(args...) /* NOP */
#define GST_CAT_WARNING_OBJECT(args...) /* NOP */
#define GST_CAT_INFO_OBJECT(args...) /* NOP */
#define GST_CAT_DEBUG_OBJECT(args...) /* NOP */
#define GST_CAT_LOG_OBJECT(args...) /* NOP */
#define GST_CAT_ERROR_OBJECT(args...) /* NOP */
#define GST_CAT_WARNING_OBJECT(args...) /* NOP */
#define GST_CAT_INFO_OBJECT(args...) /* NOP */
#define GST_CAT_DEBUG_OBJECT(args...) /* NOP */
#define GST_CAT_LOG_OBJECT(args...) /* NOP */
#define GST_CAT_ERROR(args...) /* NOP */
#define GST_CAT_WARNING(args...) /* NOP */
#define GST_CAT_INFO(args...) /* NOP */
#define GST_CAT_DEBUG(args...) /* NOP */
#define GST_CAT_LOG(args...) /* NOP */
#define GST_CAT_ERROR(args...) /* NOP */
#define GST_CAT_WARNING(args...) /* NOP */
#define GST_CAT_INFO(args...) /* NOP */
#define GST_CAT_DEBUG(args...) /* NOP */
#define GST_CAT_LOG(args...) /* NOP */
#define GST_ERROR_OBJECT(args...) /* NOP */
#define GST_WARNING_OBJECT(args...) /* NOP */
#define GST_INFO_OBJECT(args...) /* NOP */
#define GST_DEBUG_OBJECT(args...) /* NOP */
#define GST_LOG_OBJECT(args...) /* NOP */
#define GST_ERROR_OBJECT(args...) /* NOP */
#define GST_WARNING_OBJECT(args...) /* NOP */
#define GST_INFO_OBJECT(args...) /* NOP */
#define GST_DEBUG_OBJECT(args...) /* NOP */
#define GST_LOG_OBJECT(args...) /* NOP */
#define GST_ERROR(args...) /* NOP */
#define GST_WARNING(args...) /* NOP */
#define GST_INFO(args...) /* NOP */
#define GST_DEBUG(args...) /* NOP */
#define GST_LOG(args...) /* NOP */
#define GST_ERROR(args...) /* NOP */
#define GST_WARNING(args...) /* NOP */
#define GST_INFO(args...) /* NOP */
#define GST_DEBUG(args...) /* NOP */
#define GST_LOG(args...) /* NOP */
#ifdef GST_DEBUG_ENABLE_DEPRECATED
#define GST_INFO_ELEMENT(cat,obj,args...) /* NOP */
#define GST_DEBUG_ELEMENT(cat,obj,args...) /* NOP */
#define GST_DEBUG_ENTER(args...) /* NOP */
#define GST_DEBUG_LEAVE(args...) /* NOP */
#define GST_INFO_ENTER(args...) /* NOP */
#define GST_INFO_LEAVE(args...) /* NOP */
#define GST_INFO_ELEMENT(cat,obj,args...) /* NOP */
#define GST_DEBUG_ELEMENT(cat,obj,args...) /* NOP */
#define GST_DEBUG_ENTER(args...) /* NOP */
#define GST_DEBUG_LEAVE(args...) /* NOP */
#define GST_INFO_ENTER(args...) /* NOP */
#define GST_INFO_LEAVE(args...) /* NOP */
#endif /* GST_DEBUG_ENABLE_DEPRECATED */
#endif /* G_HAVE_ISO_VARARGS */
@ -517,4 +523,5 @@ gst_debug_log (GstDebugCategory * category,
void gst_debug_print_stack_trace (void);
G_END_DECLS
#endif /* __GSTINFO_H__ */

View file

@ -26,6 +26,7 @@
#include <gst/gstelement.h>
G_BEGIN_DECLS
#define GST_TYPE_IMPLEMENTS_INTERFACE \
(gst_implements_interface_get_type ())
#define GST_IMPLEMENTS_INTERFACE(obj) \
@ -41,35 +42,38 @@ G_BEGIN_DECLS
#define GST_IMPLEMENTS_INTERFACE_GET_CLASS(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_IMPLEMENTS_INTERFACE, \
GstImplementsInterfaceClass))
typedef struct _GstImplementsInterface GstImplementsInterface;
/* This small extra virtual function is here to provide an
* interface functionality on a per-instance basis rather
* than a per-class basis, which is the case for glib.
*/
typedef struct _GstImplementsInterfaceClass
{
typedef struct _GstImplementsInterfaceClass {
GTypeInterface parent;
/* virtual functions */
gboolean (*supported) (GstImplementsInterface * iface, GType iface_type);
gboolean (* supported) (GstImplementsInterface *iface,
GType iface_type);
gpointer _gst_reserved[GST_PADDING];
}
GstImplementsInterfaceClass;
} GstImplementsInterfaceClass;
#define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST(obj, type, cast_t) \
((cast_t *) gst_implements_interface_cast ((obj), (type)))
#define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE(obj, type) \
(gst_implements_interface_check ((obj), (type)))
GType gst_implements_interface_get_type (void);
GType gst_implements_interface_get_type (void);
/* wrapper functions to check for functionality implementation */
gboolean gst_element_implements_interface (GstElement * element,
GType iface_type);
gpointer gst_implements_interface_cast (gpointer from, GType type);
gboolean gst_implements_interface_check (gpointer from, GType type);
gboolean gst_element_implements_interface (GstElement *element,
GType iface_type);
gpointer gst_implements_interface_cast (gpointer from,
GType type);
gboolean gst_implements_interface_check (gpointer from,
GType type);
G_END_DECLS
#endif /* __GST_IMPLEMENTS_INTERFACE_H__ */

View file

@ -25,7 +25,9 @@
#include <glib.h>
G_BEGIN_DECLS extern const char *g_log_domain_gstreamer;
G_BEGIN_DECLS
extern const char *g_log_domain_gstreamer;
#ifdef G_HAVE_ISO_VARARGS
@ -49,4 +51,5 @@ G_BEGIN_DECLS extern const char *g_log_domain_gstreamer;
#endif
G_END_DECLS
#endif /* __GST_LOG_H__ */

View file

@ -21,12 +21,14 @@
#define __GST_MACROS_H__
G_BEGIN_DECLS
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
# define GST_GNUC_CONSTRUCTOR \
__attribute__ ((constructor))
#else /* !__GNUC__ */
#else /* !__GNUC__ */
# define GST_GNUC_CONSTRUCTOR
#endif /* !__GNUC__ */
#if defined (__GNUC__) && !defined (GST_IMPLEMENT_INLINES)
# define GST_INLINE_FUNC extern __inline__
# define GST_CAN_INLINE 1
@ -34,5 +36,9 @@ G_BEGIN_DECLS
# define GST_INLINE_FUNC extern
# undef GST_CAN_INLINE
#endif
G_END_DECLS
G_END_DECLS
#endif /* __GST_MACROS_H__ */

View file

@ -22,16 +22,22 @@
#include <glib.h>
G_BEGIN_DECLS typedef struct _GstMemChunk GstMemChunk;
G_BEGIN_DECLS
GstMemChunk *gst_mem_chunk_new (gchar * name,
gint atom_size, gulong area_size, gint type);
typedef struct _GstMemChunk GstMemChunk;
void gst_mem_chunk_destroy (GstMemChunk * mem_chunk);
GstMemChunk* gst_mem_chunk_new (gchar *name,
gint atom_size,
gulong area_size,
gint type);
gpointer gst_mem_chunk_alloc (GstMemChunk * mem_chunk);
gpointer gst_mem_chunk_alloc0 (GstMemChunk * mem_chunk);
void gst_mem_chunk_free (GstMemChunk * mem_chunk, gpointer mem);
void gst_mem_chunk_destroy (GstMemChunk *mem_chunk);
gpointer gst_mem_chunk_alloc (GstMemChunk *mem_chunk);
gpointer gst_mem_chunk_alloc0 (GstMemChunk *mem_chunk);
void gst_mem_chunk_free (GstMemChunk *mem_chunk,
gpointer mem);
G_END_DECLS
#endif /* __GST_MEM_CHUNK_H__ */

View file

@ -30,7 +30,9 @@
#include <gst/gsttypes.h>
G_BEGIN_DECLS extern GType _gst_object_type;
G_BEGIN_DECLS
extern GType _gst_object_type;
#define GST_TYPE_OBJECT (_gst_object_type)
#define GST_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_OBJECT))
@ -47,49 +49,45 @@ G_BEGIN_DECLS extern GType _gst_object_type;
typedef enum
{
GST_DESTROYED = 0,
GST_DESTROYED = 0,
GST_FLOATING,
GST_OBJECT_FLAG_LAST = 4
}
GstObjectFlags;
GST_OBJECT_FLAG_LAST = 4
} GstObjectFlags;
struct _GstObject
{
GObject object;
struct _GstObject {
GObject object;
gchar *name;
gchar *name;
/* locking for all sorts of things */
GMutex *lock;
GMutex *lock;
/* this object's parent */
GstObject *parent;
GstObject *parent;
guint32 flags;
guint32 flags;
gpointer _gst_reserved[GST_PADDING];
};
/* signal_object is used to signal to the whole class */
struct _GstObjectClass
{
GObjectClass parent_class;
struct _GstObjectClass {
GObjectClass parent_class;
gchar *path_string_separator;
GObject *signal_object;
gchar *path_string_separator;
GObject *signal_object;
/* signals */
void (*parent_set) (GstObject * object, GstObject * parent);
void (*parent_unset) (GstObject * object, GstObject * parent);
void (*object_saved) (GstObject * object, xmlNodePtr parent);
void (*deep_notify) (GstObject * object, GstObject * orig,
GParamSpec * pspec);
void (*parent_set) (GstObject *object, GstObject *parent);
void (*parent_unset) (GstObject *object, GstObject *parent);
void (*object_saved) (GstObject *object, xmlNodePtr parent);
void (*deep_notify) (GstObject *object, GstObject *orig, GParamSpec *pspec);
/* functions go here */
void (*destroy) (GstObject * object);
void (*destroy) (GstObject *object);
xmlNodePtr (*save_thyself) (GstObject * object, xmlNodePtr parent);
void (*restore_thyself) (GstObject * object, xmlNodePtr self);
xmlNodePtr (*save_thyself) (GstObject *object, xmlNodePtr parent);
void (*restore_thyself) (GstObject *object, xmlNodePtr self);
gpointer _gst_reserved[GST_PADDING];
};
@ -113,51 +111,57 @@ struct _GstObjectClass
/* normal GObject stuff */
GType gst_object_get_type (void);
GType gst_object_get_type (void);
/* name routines */
void gst_object_set_name (GstObject * object, const gchar * name);
G_CONST_RETURN gchar *gst_object_get_name (GstObject * object);
void gst_object_set_name (GstObject *object, const gchar *name);
G_CONST_RETURN gchar*
gst_object_get_name (GstObject *object);
/* parentage routines */
void gst_object_set_parent (GstObject * object, GstObject * parent);
GstObject *gst_object_get_parent (GstObject * object);
void gst_object_unparent (GstObject * object);
void gst_object_set_parent (GstObject *object, GstObject *parent);
GstObject* gst_object_get_parent (GstObject *object);
void gst_object_unparent (GstObject *object);
void gst_object_default_deep_notify (GObject * object, GstObject * orig,
GParamSpec * pspec, gchar ** excluded_props);
void gst_object_default_deep_notify (GObject *object, GstObject *orig,
GParamSpec *pspec, gchar **excluded_props);
gboolean gst_object_check_uniqueness (GList * list, const gchar * name);
gboolean gst_object_check_uniqueness (GList *list, const gchar *name);
#ifndef GST_DISABLE_LOADSAVE_REGISTRY
xmlNodePtr gst_object_save_thyself (GstObject * object, xmlNodePtr parent);
void gst_object_restore_thyself (GstObject * object, xmlNodePtr self);
xmlNodePtr gst_object_save_thyself (GstObject *object, xmlNodePtr parent);
void gst_object_restore_thyself (GstObject *object, xmlNodePtr self);
#else
#pragma GCC poison gst_object_save_thyself
#pragma GCC poison gst_object_restore_thyself
#endif
/* refcounting + life cycle */
GstObject *gst_object_ref (GstObject * object);
void gst_object_unref (GstObject * object);
void gst_object_sink (GstObject * object);
GstObject * gst_object_ref (GstObject *object);
void gst_object_unref (GstObject *object);
void gst_object_sink (GstObject *object);
/* replace object pointer */
void gst_object_replace (GstObject ** oldobj, GstObject * newobj);
void gst_object_replace (GstObject **oldobj, GstObject *newobj);
/* printing out the 'path' of the object */
gchar *gst_object_get_path_string (GstObject * object);
gchar * gst_object_get_path_string (GstObject *object);
guint gst_class_signal_connect (GstObjectClass * klass,
const gchar * name, gpointer func, gpointer func_data);
guint gst_class_signal_connect (GstObjectClass *klass,
const gchar *name,
gpointer func,
gpointer func_data);
#ifndef GST_DISABLE_LOADSAVE_REGISTRY
void gst_class_signal_emit_by_name (GstObject * object,
const gchar * name, xmlNodePtr self);
void gst_class_signal_emit_by_name (GstObject *object,
const gchar *name,
xmlNodePtr self);
#else
#pragma GCC poison gst_class_signal_emit_by_name
#endif
G_END_DECLS
#endif /* __GST_OBJECT_H__ */

View file

@ -34,7 +34,9 @@
#include <gst/gstquery.h>
G_BEGIN_DECLS extern GType _gst_pad_type;
G_BEGIN_DECLS
extern GType _gst_pad_type;
extern GType _gst_real_pad_type;
extern GType _gst_ghost_pad_type;
@ -76,20 +78,17 @@ typedef struct _GstRealPad GstRealPad;
typedef struct _GstRealPadClass GstRealPadClass;
typedef struct _GstGhostPad GstGhostPad;
typedef struct _GstGhostPadClass GstGhostPadClass;
/*typedef struct _GstPadTemplate GstPadTemplate;*/
/*typedef struct _GstPadTemplateClass GstPadTemplateClass;*/
typedef struct _GstStaticPadTemplate GstStaticPadTemplate;
typedef struct _GstPadLink GstPadLink;
typedef enum
{
typedef enum {
GST_PAD_LINK_REFUSED = -1,
GST_PAD_LINK_DELAYED = 0,
GST_PAD_LINK_OK = 1,
GST_PAD_LINK_DONE = 2
}
GstPadLinkReturn;
GST_PAD_LINK_DELAYED = 0,
GST_PAD_LINK_OK = 1,
GST_PAD_LINK_DONE = 2
} GstPadLinkReturn;
#define GST_PAD_LINK_FAILED(ret) (ret < GST_PAD_LINK_OK)
#define GST_PAD_LINK_SUCCESSFUL(ret) (ret >= GST_PAD_LINK_OK)
@ -111,127 +110,116 @@ GstPadLinkReturn;
/* this defines the functions used to chain buffers
* pad is the sink pad (so the same chain function can be used for N pads)
* buf is the buffer being passed */
typedef void (*GstPadChainFunction) (GstPad * pad, GstData * data);
typedef GstData *(*GstPadGetFunction) (GstPad * pad);
typedef gboolean (*GstPadEventFunction) (GstPad * pad, GstEvent * event);
typedef gboolean (*GstPadConvertFunction) (GstPad * pad,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
typedef gboolean (*GstPadQueryFunction) (GstPad * pad, GstQueryType type,
GstFormat * format, gint64 * value);
typedef GList *(*GstPadIntLinkFunction) (GstPad * pad);
typedef const GstFormat *(*GstPadFormatsFunction) (GstPad * pad);
typedef const GstEventMask *(*GstPadEventMaskFunction) (GstPad * pad);
typedef const GstQueryType *(*GstPadQueryTypeFunction) (GstPad * pad);
typedef void (*GstPadChainFunction) (GstPad *pad,GstData *data);
typedef GstData* (*GstPadGetFunction) (GstPad *pad);
typedef gboolean (*GstPadEventFunction) (GstPad *pad, GstEvent *event);
typedef gboolean (*GstPadConvertFunction) (GstPad *pad,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
typedef const GstFormat* (*GstPadFormatsFunction) (GstPad *pad);
typedef const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad);
typedef const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad * pad,
const GstCaps * caps);
typedef void (*GstPadUnlinkFunction) (GstPad * pad);
typedef GstCaps *(*GstPadGetCapsFunction) (GstPad * pad);
typedef GstCaps *(*GstPadFixateFunction) (GstPad * pad, const GstCaps * caps);
typedef GstBuffer *(*GstPadBufferAllocFunction) (GstPad * pad, guint64 offset,
guint size);
typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, const GstCaps *caps);
typedef void (*GstPadUnlinkFunction) (GstPad *pad);
typedef GstCaps* (*GstPadGetCapsFunction) (GstPad *pad);
typedef GstCaps* (*GstPadFixateFunction) (GstPad *pad, const GstCaps *caps);
typedef GstBuffer* (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size);
typedef gboolean (*GstPadDispatcherFunction) (GstPad * pad, gpointer data);
typedef gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
typedef enum
{
typedef enum {
GST_PAD_UNKNOWN,
GST_PAD_SRC,
GST_PAD_SINK
}
GstPadDirection;
} GstPadDirection;
typedef enum
{
GST_PAD_DISABLED = GST_OBJECT_FLAG_LAST,
typedef enum {
GST_PAD_DISABLED = GST_OBJECT_FLAG_LAST,
GST_PAD_NEGOTIATING,
GST_PAD_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4
}
GstPadFlags;
GST_PAD_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4
} GstPadFlags;
struct _GstPad
{
GstObject object;
struct _GstPad {
GstObject object;
gpointer element_private;
gpointer element_private;
GstPadTemplate *padtemplate; /* the template for this pad */
GstPadTemplate *padtemplate; /* the template for this pad */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstPadClass
{
struct _GstPadClass {
GstObjectClass parent_class;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstRealPad
{
GstPad pad;
struct _GstRealPad {
GstPad pad;
/* the pad capabilities */
GstCaps *caps;
GstPadFixateFunction appfixatefunc;
GstCaps *appfilter;
GstPadGetCapsFunction getcapsfunc;
GstPadFixateFunction fixatefunc;
GstCaps *caps;
GstPadFixateFunction appfixatefunc;
GstCaps *appfilter;
GstPadGetCapsFunction getcapsfunc;
GstPadFixateFunction fixatefunc;
GstPadDirection direction;
GstPadDirection direction;
GstPadLinkFunction linkfunc;
GstPadUnlinkFunction unlinkfunc;
GstRealPad *peer;
GstPadLinkFunction linkfunc;
GstPadUnlinkFunction unlinkfunc;
GstRealPad *peer;
gpointer sched_private;
gpointer sched_private;
/* data transport functions */
GstPadChainFunction chainfunc;
GstPadChainFunction chainhandler;
GstPadGetFunction getfunc;
GstPadGetFunction gethandler;
GstPadEventFunction eventfunc;
GstPadEventFunction eventhandler;
GstPadEventMaskFunction eventmaskfunc;
GstPadChainFunction chainfunc;
GstPadChainFunction chainhandler;
GstPadGetFunction getfunc;
GstPadGetFunction gethandler;
GstPadEventFunction eventfunc;
GstPadEventFunction eventhandler;
GstPadEventMaskFunction eventmaskfunc;
GList *ghostpads;
GList *ghostpads;
/* query/convert/formats functions */
GstPadConvertFunction convertfunc;
GstPadQueryFunction queryfunc;
GstPadFormatsFunction formatsfunc;
GstPadQueryTypeFunction querytypefunc;
GstPadIntLinkFunction intlinkfunc;
GstPadConvertFunction convertfunc;
GstPadQueryFunction queryfunc;
GstPadFormatsFunction formatsfunc;
GstPadQueryTypeFunction querytypefunc;
GstPadIntLinkFunction intlinkfunc;
GstPadBufferAllocFunction bufferallocfunc;
GstPadBufferAllocFunction bufferallocfunc;
GstProbeDispatcher probedisp;
GstProbeDispatcher probedisp;
GstPadLink *link;
GstCaps *explicit_caps;
GstPadLink *link;
GstCaps *explicit_caps;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstRealPadClass
{
GstPadClass parent_class;
struct _GstRealPadClass {
GstPadClass parent_class;
/* signal callbacks */
void (*caps_nego_failed) (GstPad * pad, GstCaps * caps);
void (*caps_nego_failed) (GstPad *pad, GstCaps *caps);
void (*linked) (GstPad * pad, GstPad * peer);
void (*unlinked) (GstPad * pad, GstPad * peer);
GstPadFixateFunction appfixatefunc;
void (*linked) (GstPad *pad, GstPad *peer);
void (*unlinked) (GstPad *pad, GstPad *peer);
GstPadFixateFunction appfixatefunc;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstGhostPad
{
struct _GstGhostPad {
GstPad pad;
GstRealPad *realpad;
@ -239,8 +227,7 @@ struct _GstGhostPad
gpointer _gst_reserved[GST_PADDING];
};
struct _GstGhostPadClass
{
struct _GstGhostPadClass {
GstPadClass parent_class;
gpointer _gst_reserved[GST_PADDING];
@ -306,57 +293,50 @@ struct _GstGhostPadClass
#define GST_IS_PAD_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD_TEMPLATE))
#define GST_IS_PAD_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD_TEMPLATE))
typedef enum
{
typedef enum {
GST_PAD_ALWAYS,
GST_PAD_SOMETIMES,
GST_PAD_REQUEST
}
GstPadPresence;
} GstPadPresence;
#define GST_PAD_TEMPLATE_NAME_TEMPLATE(templ) (((GstPadTemplate *)(templ))->name_template)
#define GST_PAD_TEMPLATE_DIRECTION(templ) (((GstPadTemplate *)(templ))->direction)
#define GST_PAD_TEMPLATE_PRESENCE(templ) (((GstPadTemplate *)(templ))->presence)
#define GST_PAD_TEMPLATE_CAPS(templ) (((GstPadTemplate *)(templ))->caps)
typedef enum
{
GST_PAD_TEMPLATE_FIXED = GST_OBJECT_FLAG_LAST,
typedef enum {
GST_PAD_TEMPLATE_FIXED = GST_OBJECT_FLAG_LAST,
GST_PAD_TEMPLATE_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4
}
GstPadTemplateFlags;
GST_PAD_TEMPLATE_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4
} GstPadTemplateFlags;
#define GST_PAD_TEMPLATE_IS_FIXED(templ) (GST_FLAG_IS_SET(templ, GST_PAD_TEMPLATE_FIXED))
struct _GstPadTemplate
{
GstObject object;
struct _GstPadTemplate {
GstObject object;
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps *caps;
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps *caps;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstPadTemplateClass
{
GstObjectClass parent_class;
struct _GstPadTemplateClass {
GstObjectClass parent_class;
/* signal callbacks */
void (*pad_created) (GstPadTemplate * templ, GstPad * pad);
void (*pad_created) (GstPadTemplate *templ, GstPad *pad);
gpointer _gst_reserved[GST_PADDING];
};
struct _GstStaticPadTemplate
{
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstStaticCaps static_caps;
struct _GstStaticPadTemplate {
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstStaticCaps static_caps;
};
#define GST_STATIC_PAD_TEMPLATE(padname, dir, pres, caps) \
@ -368,145 +348,140 @@ struct _GstStaticPadTemplate
}
GType gst_pad_get_type (void);
GType gst_real_pad_get_type (void);
GType gst_ghost_pad_get_type (void);
GType gst_pad_get_type (void);
GType gst_real_pad_get_type (void);
GType gst_ghost_pad_get_type (void);
/* creating pads */
GstPad *gst_pad_new (const gchar * name, GstPadDirection direction);
GstPad *gst_pad_new_from_template (GstPadTemplate * templ, const gchar * name);
GstPad *gst_pad_custom_new (GType type, const gchar * name,
GstPadDirection direction);
GstPad *gst_pad_custom_new_from_template (GType type, GstPadTemplate * templ,
const gchar * name);
GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
GstPad* gst_pad_custom_new (GType type, const gchar *name, GstPadDirection direction);
GstPad* gst_pad_custom_new_from_template (GType type, GstPadTemplate *templ, const gchar *name);
void gst_pad_set_name (GstPad * pad, const gchar * name);
G_CONST_RETURN gchar *gst_pad_get_name (GstPad * pad);
void gst_pad_set_name (GstPad *pad, const gchar *name);
G_CONST_RETURN gchar* gst_pad_get_name (GstPad *pad);
GstPadDirection gst_pad_get_direction (GstPad * pad);
GstPadDirection gst_pad_get_direction (GstPad *pad);
void gst_pad_set_active (GstPad * pad, gboolean active);
gboolean gst_pad_is_active (GstPad * pad);
void gst_pad_set_active (GstPad *pad, gboolean active);
gboolean gst_pad_is_active (GstPad *pad);
void gst_pad_set_element_private (GstPad * pad, gpointer priv);
gpointer gst_pad_get_element_private (GstPad * pad);
void gst_pad_set_element_private (GstPad *pad, gpointer priv);
gpointer gst_pad_get_element_private (GstPad *pad);
void gst_pad_set_parent (GstPad * pad, GstElement * parent);
GstElement *gst_pad_get_parent (GstPad * pad);
GstElement *gst_pad_get_real_parent (GstPad * pad);
void gst_pad_set_parent (GstPad *pad, GstElement *parent);
GstElement* gst_pad_get_parent (GstPad *pad);
GstElement* gst_pad_get_real_parent (GstPad *pad);
GstScheduler *gst_pad_get_scheduler (GstPad * pad);
GstScheduler* gst_pad_get_scheduler (GstPad *pad);
void gst_pad_add_ghost_pad (GstPad * pad, GstPad * ghostpad);
void gst_pad_remove_ghost_pad (GstPad * pad, GstPad * ghostpad);
GList *gst_pad_get_ghost_pad_list (GstPad * pad);
void gst_pad_add_ghost_pad (GstPad *pad, GstPad *ghostpad);
void gst_pad_remove_ghost_pad (GstPad *pad, GstPad *ghostpad);
GList* gst_pad_get_ghost_pad_list (GstPad *pad);
GstPadTemplate *gst_pad_get_pad_template (GstPad * pad);
GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
void gst_pad_set_bufferalloc_function (GstPad * pad,
GstPadBufferAllocFunction bufferalloc);
GstBuffer *gst_pad_alloc_buffer (GstPad * pad, guint64 offset, gint size);
void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufferalloc);
GstBuffer* gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size);
/* data passing setup functions */
void gst_pad_set_chain_function (GstPad * pad, GstPadChainFunction chain);
void gst_pad_set_get_function (GstPad * pad, GstPadGetFunction get);
void gst_pad_set_event_function (GstPad * pad, GstPadEventFunction event);
void gst_pad_set_event_mask_function (GstPad * pad,
GstPadEventMaskFunction mask_func);
G_CONST_RETURN GstEventMask *gst_pad_get_event_masks (GstPad * pad);
G_CONST_RETURN GstEventMask *gst_pad_get_event_masks_default (GstPad * pad);
void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain);
void gst_pad_set_get_function (GstPad *pad, GstPadGetFunction get);
void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event);
void gst_pad_set_event_mask_function (GstPad *pad, GstPadEventMaskFunction mask_func);
G_CONST_RETURN GstEventMask*
gst_pad_get_event_masks (GstPad *pad);
G_CONST_RETURN GstEventMask*
gst_pad_get_event_masks_default (GstPad *pad);
/* pad links */
void gst_pad_set_link_function (GstPad * pad, GstPadLinkFunction link);
gboolean gst_pad_can_link (GstPad * srcpad, GstPad * sinkpad);
gboolean gst_pad_can_link_filtered (GstPad * srcpad, GstPad * sinkpad,
const GstCaps * filtercaps);
void gst_pad_set_unlink_function (GstPad * pad, GstPadUnlinkFunction unlink);
void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink);
gboolean gst_pad_link (GstPad * srcpad, GstPad * sinkpad);
gboolean gst_pad_link_filtered (GstPad * srcpad, GstPad * sinkpad,
const GstCaps * filtercaps);
void gst_pad_unlink (GstPad * srcpad, GstPad * sinkpad);
gboolean gst_pad_is_linked (GstPad * pad);
gboolean gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_is_linked (GstPad *pad);
GstPad *gst_pad_get_peer (GstPad * pad);
GstPad* gst_pad_get_peer (GstPad *pad);
/* capsnego functions */
G_CONST_RETURN GstCaps *gst_pad_get_negotiated_caps (GstPad * pad);
gboolean gst_pad_is_negotiated (GstPad * pad);
GstCaps *gst_pad_get_caps (GstPad * pad);
G_CONST_RETURN GstCaps *gst_pad_get_pad_template_caps (GstPad * pad);
GstPadLinkReturn gst_pad_try_set_caps (GstPad * pad, const GstCaps * caps);
GstPadLinkReturn gst_pad_try_set_caps_nonfixed (GstPad * pad,
const GstCaps * caps);
gboolean gst_pad_check_compatibility (GstPad * srcpad, GstPad * sinkpad);
void gst_pad_set_getcaps_function (GstPad * pad, GstPadGetCapsFunction getcaps);
void gst_pad_set_fixate_function (GstPad * pad, GstPadFixateFunction fixate);
GstCaps *gst_pad_proxy_getcaps (GstPad * pad);
GstPadLinkReturn gst_pad_proxy_pad_link (GstPad * pad, const GstCaps * caps);
GstCaps *gst_pad_proxy_fixate (GstPad * pad, const GstCaps * caps);
G_CONST_RETURN GstCaps* gst_pad_get_negotiated_caps (GstPad *pad);
gboolean gst_pad_is_negotiated (GstPad *pad);
GstCaps* gst_pad_get_caps (GstPad *pad);
G_CONST_RETURN GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps);
GstPadLinkReturn gst_pad_try_set_caps_nonfixed (GstPad *pad, const GstCaps *caps);
gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad);
void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
void gst_pad_set_fixate_function (GstPad *pad, GstPadFixateFunction fixate);
GstCaps * gst_pad_proxy_getcaps (GstPad *pad);
GstPadLinkReturn gst_pad_proxy_pad_link (GstPad *pad, const GstCaps *caps);
GstCaps * gst_pad_proxy_fixate (GstPad *pad, const GstCaps *caps);
#ifndef GST_DISABLE_DEPRECATED
GstPadLinkReturn gst_pad_proxy_link (GstPad * pad, const GstCaps * caps);
GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, const GstCaps *caps);
#endif
gboolean gst_pad_set_explicit_caps (GstPad * pad, const GstCaps * caps);
void gst_pad_use_explicit_caps (GstPad * pad);
gboolean gst_pad_relink_filtered (GstPad * srcpad, GstPad * sinkpad,
const GstCaps * filtercaps);
gboolean gst_pad_set_explicit_caps (GstPad *pad, const GstCaps *caps);
void gst_pad_use_explicit_caps (GstPad *pad);
gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
#ifndef GST_DISABLE_DEPRECATED
gboolean gst_pad_perform_negotiate (GstPad * srcpad, GstPad * sinkpad);
gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad);
#endif
GstPadLinkReturn gst_pad_renegotiate (GstPad * pad);
void gst_pad_unnegotiate (GstPad * pad);
gboolean gst_pad_try_relink_filtered (GstPad * srcpad, GstPad * sinkpad,
const GstCaps * filtercaps);
GstCaps *gst_pad_get_allowed_caps (GstPad * pad);
void gst_pad_caps_change_notify (GstPad * pad);
GstPadLinkReturn gst_pad_renegotiate (GstPad *pad);
void gst_pad_unnegotiate (GstPad *pad);
gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
GstCaps* gst_pad_get_allowed_caps (GstPad *pad);
void gst_pad_caps_change_notify (GstPad *pad);
gboolean gst_pad_recover_caps_error (GstPad * pad, const GstCaps * allowed);
gboolean gst_pad_recover_caps_error (GstPad *pad, const GstCaps *allowed);
/* data passing functions */
void gst_pad_push (GstPad * pad, GstData * data);
GstData *gst_pad_pull (GstPad * pad);
gboolean gst_pad_send_event (GstPad * pad, GstEvent * event);
gboolean gst_pad_event_default (GstPad * pad, GstEvent * event);
GstPad *gst_pad_selectv (GList * padlist);
GstPad *gst_pad_select (GstPad * pad, ...);
GstPad *gst_pad_select_valist (GstPad * pad, va_list varargs);
void gst_pad_push (GstPad *pad, GstData *data);
GstData* gst_pad_pull (GstPad *pad);
gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
gboolean gst_pad_event_default (GstPad *pad, GstEvent *event);
GstPad* gst_pad_selectv (GList *padlist);
GstPad* gst_pad_select (GstPad *pad, ...);
GstPad* gst_pad_select_valist (GstPad *pad, va_list varargs);
/* convert/query/format functions */
void gst_pad_set_formats_function (GstPad * pad, GstPadFormatsFunction formats);
G_CONST_RETURN GstFormat *gst_pad_get_formats (GstPad * pad);
G_CONST_RETURN GstFormat *gst_pad_get_formats_default (GstPad * pad);
void gst_pad_set_formats_function (GstPad *pad,
GstPadFormatsFunction formats);
G_CONST_RETURN GstFormat*
gst_pad_get_formats (GstPad *pad);
G_CONST_RETURN GstFormat*
gst_pad_get_formats_default (GstPad *pad);
void gst_pad_set_convert_function (GstPad * pad, GstPadConvertFunction convert);
gboolean gst_pad_convert (GstPad * pad,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
gboolean gst_pad_convert_default (GstPad * pad,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
void gst_pad_set_convert_function (GstPad *pad, GstPadConvertFunction convert);
gboolean gst_pad_convert (GstPad *pad,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
gboolean gst_pad_convert_default (GstPad *pad,
GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value);
void gst_pad_set_query_function (GstPad * pad, GstPadQueryFunction query);
void gst_pad_set_query_type_function (GstPad * pad,
GstPadQueryTypeFunction type_func);
G_CONST_RETURN GstQueryType *gst_pad_get_query_types (GstPad * pad);
G_CONST_RETURN GstQueryType *gst_pad_get_query_types_default (GstPad * pad);
gboolean gst_pad_query (GstPad * pad, GstQueryType type,
GstFormat * format, gint64 * value);
gboolean gst_pad_query_default (GstPad * pad, GstQueryType type,
GstFormat * format, gint64 * value);
void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func);
G_CONST_RETURN GstQueryType*
gst_pad_get_query_types (GstPad *pad);
G_CONST_RETURN GstQueryType*
gst_pad_get_query_types_default (GstPad *pad);
gboolean gst_pad_query (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
gboolean gst_pad_query_default (GstPad *pad, GstQueryType type,
GstFormat *format, gint64 *value);
void gst_pad_set_internal_link_function (GstPad * pad,
GstPadIntLinkFunction intlink);
GList *gst_pad_get_internal_links (GstPad * pad);
GList *gst_pad_get_internal_links_default (GstPad * pad);
void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
GList* gst_pad_get_internal_links (GstPad *pad);
GList* gst_pad_get_internal_links_default (GstPad *pad);
/* misc helper functions */
gboolean gst_pad_dispatcher (GstPad * pad, GstPadDispatcherFunction dispatch,
gpointer data);
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
gpointer data);
#define gst_pad_add_probe(pad, probe) \
(gst_probe_dispatcher_add_probe (&(GST_REAL_PAD (pad)->probedisp), probe))
@ -514,28 +489,31 @@ gboolean gst_pad_dispatcher (GstPad * pad, GstPadDispatcherFunction dispatch,
(gst_probe_dispatcher_remove_probe (&(GST_REAL_PAD (pad)->probedisp), probe))
#ifndef GST_DISABLE_LOADSAVE
void gst_pad_load_and_link (xmlNodePtr self, GstObject * parent);
void gst_pad_load_and_link (xmlNodePtr self, GstObject *parent);
#endif
/* ghostpads */
GstPad *gst_ghost_pad_new (const gchar * name, GstPad * pad);
GstPad* gst_ghost_pad_new (const gchar *name, GstPad *pad);
/* templates and factories */
GType gst_pad_template_get_type (void);
GType gst_pad_template_get_type (void);
GstPadTemplate *gst_pad_template_new (const gchar * name_template,
GstPadDirection direction, GstPadPresence presence, GstCaps * caps);
GstPadTemplate* gst_pad_template_new (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps);
GstPadTemplate *gst_static_pad_template_get (GstStaticPadTemplate * templ);
const GstCaps *gst_pad_template_get_caps (GstPadTemplate * templ);
const GstCaps *gst_pad_template_get_caps_by_name (GstPadTemplate * templ,
const gchar * name);
GstPadTemplate * gst_static_pad_template_get (GstStaticPadTemplate *templ);
const GstCaps* gst_pad_template_get_caps (GstPadTemplate *templ);
const GstCaps* gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name);
#ifndef GST_DISABLE_LOADSAVE
xmlNodePtr gst_ghost_pad_save_thyself (GstPad * pad, xmlNodePtr parent);
xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad,
xmlNodePtr parent);
#endif
G_END_DECLS
#endif /* __GST_PAD_H__ */

View file

@ -26,9 +26,10 @@
#include <gst/gstbin.h>
G_BEGIN_DECLS
#ifndef GST_DISABLE_PARSE
GQuark gst_parse_error_quark (void);
#ifndef GST_DISABLE_PARSE
GQuark gst_parse_error_quark (void);
#define GST_PARSE_ERROR gst_parse_error_quark ()
typedef enum
@ -40,17 +41,19 @@ typedef enum
GST_PARSE_ERROR_COULD_NOT_SET_PROPERTY,
GST_PARSE_ERROR_EMPTY_BIN,
GST_PARSE_ERROR_EMPTY
}
GstParseError;
} GstParseError;
GstElement *gst_parse_launch (const gchar * pipeline_description,
GError ** error);
GstElement *gst_parse_launchv (const gchar ** argv, GError ** error);
GstElement* gst_parse_launch (const gchar *pipeline_description, GError **error);
GstElement* gst_parse_launchv (const gchar **argv, GError **error);
#else /* GST_DISABLE_PARSE */
#pragma GCC poison gst_parse_launch
#pragma GCC poison gst_parse_launchv
#endif /* GST_DISABLE_PARSE */
G_END_DECLS
G_END_DECLS
#endif /* __GST_PARSE_H__ */

View file

@ -27,32 +27,34 @@
#include <gst/gstbin.h>
G_BEGIN_DECLS
#define GST_TYPE_PIPELINE (gst_pipeline_get_type ())
#define GST_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PIPELINE, GstPipeline))
#define GST_IS_PIPELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PIPELINE))
#define GST_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PIPELINE, GstPipelineClass))
#define GST_IS_PIPELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PIPELINE))
#define GST_PIPELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PIPELINE, GstPipelineClass))
typedef struct _GstPipeline GstPipeline;
typedef struct _GstPipelineClass GstPipelineClass;
struct _GstPipeline
{
GstBin bin;
struct _GstPipeline {
GstBin bin;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstPipelineClass
{
struct _GstPipelineClass {
GstBinClass parent_class;
gpointer _gst_reserved[GST_PADDING];
};
GType gst_pipeline_get_type (void);
GstElement *gst_pipeline_new (const gchar * name);
GType gst_pipeline_get_type (void);
GstElement* gst_pipeline_new (const gchar *name);
G_END_DECLS
#endif /* __GST_PIPELINE_H__ */

View file

@ -30,8 +30,9 @@
#include <gst/gstpluginfeature.h>
#include <gst/gstmacros.h>
G_BEGIN_DECLS GQuark gst_plugin_error_quark (void);
G_BEGIN_DECLS
GQuark gst_plugin_error_quark (void);
#define GST_PLUGIN_ERROR gst_plugin_error_quark ()
typedef enum
@ -39,46 +40,42 @@ typedef enum
GST_PLUGIN_ERROR_MODULE,
GST_PLUGIN_ERROR_DEPENDENCIES,
GST_PLUGIN_ERROR_NAME_MISMATCH
}
GstPluginError;
} GstPluginError;
#define GST_PLUGIN(plugin) ((GstPlugin *) (plugin))
typedef struct _GstPlugin GstPlugin;
typedef struct _GstPluginDesc GstPluginDesc;
typedef struct _GstPlugin GstPlugin;
typedef struct _GstPluginDesc GstPluginDesc;
/* Initialiser function: returns TRUE if plugin initialised successfully */
typedef gboolean (*GstPluginInitFunc) (GstPlugin * plugin);
typedef gboolean (*GstPluginInitFunc) (GstPlugin *plugin);
/* exiting function when plugin is unloaded */
typedef void (*GstPluginExitFunc) (GstPlugin * plugin);
typedef void (*GstPluginExitFunc) (GstPlugin *plugin);
struct _GstPluginDesc
{
gint major_version; /* major version of core that plugin was compiled for */
gint minor_version; /* minor version of core that plugin was compiled for */
gchar *name; /* unique name of plugin */
gchar *description; /* description of plugin */
struct _GstPluginDesc {
gint major_version; /* major version of core that plugin was compiled for */
gint minor_version; /* minor version of core that plugin was compiled for */
gchar *name; /* unique name of plugin */
gchar *description; /* description of plugin */
GstPluginInitFunc plugin_init; /* pointer to plugin_init function */
GstPluginExitFunc plugin_exit; /* pointer to exiting function */
gchar *version; /* version of the plugin */
gchar *license; /* effective license of plugin */
gchar *package; /* package plugin belongs to */
gchar *origin; /* URL to provider of plugin */
gchar *version; /* version of the plugin */
gchar *license; /* effective license of plugin */
gchar *package; /* package plugin belongs to */
gchar *origin; /* URL to provider of plugin */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstPlugin
{
GstPluginDesc desc;
struct _GstPlugin {
GstPluginDesc desc;
gchar *filename;
GList *features; /* list of features provided */
gint numfeatures;
gchar * filename;
GList * features; /* list of features provided */
gint numfeatures;
gpointer manager; /* managing registry */
GModule *module; /* contains the module if the plugin is loaded */
gpointer manager; /* managing registry */
GModule * module; /* contains the module if the plugin is loaded */
gpointer _gst_reserved[GST_PADDING];
};
@ -122,40 +119,45 @@ _gst_plugin_static_init__ ##init (void) \
/* function for filters */
typedef gboolean (*GstPluginFilter) (GstPlugin * plugin, gpointer user_data);
typedef gboolean (*GstPluginFilter) (GstPlugin *plugin,
gpointer user_data);
#define GST_TYPE_PLUGIN (gst_plugin_get_type())
GType gst_plugin_get_type (void);
void _gst_plugin_initialize (void);
void _gst_plugin_register_static (GstPluginDesc * desc);
GType gst_plugin_get_type (void);
void _gst_plugin_initialize (void);
void _gst_plugin_register_static (GstPluginDesc *desc);
G_CONST_RETURN gchar *gst_plugin_get_name (GstPlugin * plugin);
G_CONST_RETURN gchar *gst_plugin_get_description (GstPlugin * plugin);
G_CONST_RETURN gchar *gst_plugin_get_filename (GstPlugin * plugin);
G_CONST_RETURN gchar *gst_plugin_get_license (GstPlugin * plugin);
G_CONST_RETURN gchar *gst_plugin_get_package (GstPlugin * plugin);
G_CONST_RETURN gchar *gst_plugin_get_origin (GstPlugin * plugin);
GModule *gst_plugin_get_module (GstPlugin * plugin);
gboolean gst_plugin_is_loaded (GstPlugin * plugin);
G_CONST_RETURN gchar* gst_plugin_get_name (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_description (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_filename (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_license (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin);
G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin);
GModule * gst_plugin_get_module (GstPlugin *plugin);
gboolean gst_plugin_is_loaded (GstPlugin *plugin);
GList *gst_plugin_feature_filter (GstPlugin * plugin,
GstPluginFeatureFilter filter, gboolean first, gpointer user_data);
GList *gst_plugin_list_feature_filter (GList * list,
GstPluginFeatureFilter filter, gboolean first, gpointer user_data);
gboolean gst_plugin_name_filter (GstPlugin * plugin, const gchar * name);
GList* gst_plugin_feature_filter (GstPlugin *plugin,
GstPluginFeatureFilter filter,
gboolean first,
gpointer user_data);
GList* gst_plugin_list_feature_filter (GList *list,
GstPluginFeatureFilter filter,
gboolean first,
gpointer user_data);
gboolean gst_plugin_name_filter (GstPlugin *plugin, const gchar *name);
GList *gst_plugin_get_feature_list (GstPlugin * plugin);
GstPluginFeature *gst_plugin_find_feature (GstPlugin * plugin,
const gchar * name, GType type);
GList* gst_plugin_get_feature_list (GstPlugin *plugin);
GstPluginFeature* gst_plugin_find_feature (GstPlugin *plugin, const gchar *name, GType type);
GstPlugin *gst_plugin_load_file (const gchar * filename, GError ** error);
gboolean gst_plugin_unload_plugin (GstPlugin * plugin);
GstPlugin * gst_plugin_load_file (const gchar *filename, GError** error);
gboolean gst_plugin_unload_plugin (GstPlugin *plugin);
void gst_plugin_add_feature (GstPlugin * plugin, GstPluginFeature * feature);
void gst_plugin_add_feature (GstPlugin *plugin, GstPluginFeature *feature);
/* shortcuts to load from the registry pool */
gboolean gst_plugin_load (const gchar * name);
gboolean gst_library_load (const gchar * name);
gboolean gst_plugin_load (const gchar *name);
gboolean gst_library_load (const gchar *name);
G_END_DECLS
#endif /* __GST_PLUGIN_H__ */

View file

@ -28,63 +28,64 @@
#include <gst/gsttypes.h>
G_BEGIN_DECLS
#define GST_TYPE_PLUGIN_FEATURE (gst_plugin_feature_get_type())
#define GST_PLUGIN_FEATURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLUGIN_FEATURE, GstPluginFeature))
#define GST_IS_PLUGIN_FEATURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLUGIN_FEATURE))
#define GST_PLUGIN_FEATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLUGIN_FEATURE, GstPluginFeatureClass))
#define GST_IS_PLUGIN_FEATURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLUGIN_FEATURE))
#define GST_PLUGIN_FEATURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLUGIN_FEATURE, GstPluginFeatureClass))
#define GST_PLUGIN_FEATURE_NAME(feature) (GST_PLUGIN_FEATURE (feature)->name)
typedef struct _GstPluginFeature GstPluginFeature;
typedef struct _GstPluginFeatureClass GstPluginFeatureClass;
struct _GstPluginFeature
{
GObject object;
struct _GstPluginFeature {
GObject object;
/*< private > */
gchar *name;
guint rank;
/*< private >*/
gchar *name;
guint rank;
gpointer manager;
gpointer manager;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstPluginFeatureClass
{
GObjectClass parent_class;
struct _GstPluginFeatureClass {
GObjectClass parent_class;
void (*unload_thyself) (GstPluginFeature * feature);
void (*unload_thyself) (GstPluginFeature *feature);
gpointer _gst_reserved[GST_PADDING];
};
typedef struct
{
const gchar *name;
GType type;
}
GstTypeNameData;
typedef struct {
const gchar *name;
GType type;
} GstTypeNameData;
/* filter */
typedef gboolean (*GstPluginFeatureFilter) (GstPluginFeature * feature,
gpointer user_data);
typedef gboolean (*GstPluginFeatureFilter) (GstPluginFeature *feature,
gpointer user_data);
/* normal GObject stuff */
GType gst_plugin_feature_get_type (void);
GType gst_plugin_feature_get_type (void);
gboolean gst_plugin_feature_ensure_loaded (GstPluginFeature * feature);
void gst_plugin_feature_unload_thyself (GstPluginFeature * feature);
gboolean gst_plugin_feature_ensure_loaded (GstPluginFeature *feature);
void gst_plugin_feature_unload_thyself (GstPluginFeature *feature);
gboolean gst_plugin_feature_type_name_filter (GstPluginFeature * feature,
GstTypeNameData * data);
gboolean gst_plugin_feature_type_name_filter (GstPluginFeature *feature,
GstTypeNameData *data);
void gst_plugin_feature_set_rank (GstPluginFeature * feature, guint rank);
void gst_plugin_feature_set_name (GstPluginFeature * feature,
const gchar * name);
guint gst_plugin_feature_get_rank (GstPluginFeature * feature);
G_CONST_RETURN gchar *gst_plugin_feature_get_name (GstPluginFeature * feature);
void gst_plugin_feature_set_rank (GstPluginFeature *feature, guint rank);
void gst_plugin_feature_set_name (GstPluginFeature *feature, const gchar *name);
guint gst_plugin_feature_get_rank (GstPluginFeature *feature);
G_CONST_RETURN gchar *gst_plugin_feature_get_name (GstPluginFeature *feature);
G_END_DECLS
#endif /* __GST_PLUGIN_FEATURE_H__ */

View file

@ -27,49 +27,50 @@
#include <glib.h>
#include <gst/gstdata.h>
G_BEGIN_DECLS typedef struct _GstProbe GstProbe;
G_BEGIN_DECLS
typedef struct _GstProbe GstProbe;
/* the callback should return FALSE if the data should be discarded */
typedef gboolean (*GstProbeCallback) (GstProbe * probe,
GstData ** data, gpointer user_data);
typedef gboolean (*GstProbeCallback) (GstProbe *probe,
GstData **data,
gpointer user_data);
struct _GstProbe
{
gboolean single_shot;
struct _GstProbe {
gboolean single_shot;
GstProbeCallback callback;
gpointer user_data;
GstProbeCallback callback;
gpointer user_data;
};
GstProbe *gst_probe_new (gboolean single_shot,
GstProbeCallback callback, gpointer user_data);
void gst_probe_destroy (GstProbe * probe);
GstProbe* gst_probe_new (gboolean single_shot,
GstProbeCallback callback,
gpointer user_data);
void gst_probe_destroy (GstProbe *probe);
gboolean gst_probe_perform (GstProbe * probe, GstData ** data);
gboolean gst_probe_perform (GstProbe *probe, GstData **data);
typedef struct _GstProbeDispatcher GstProbeDispatcher;
struct _GstProbeDispatcher
{
gboolean active;
struct _GstProbeDispatcher {
gboolean active;
GSList *probes;
GSList *probes;
};
GstProbeDispatcher *gst_probe_dispatcher_new (void);
void gst_probe_dispatcher_destroy (GstProbeDispatcher * disp);
void gst_probe_dispatcher_init (GstProbeDispatcher * disp);
GstProbeDispatcher* gst_probe_dispatcher_new (void);
void gst_probe_dispatcher_destroy (GstProbeDispatcher *disp);
void gst_probe_dispatcher_init (GstProbeDispatcher *disp);
void gst_probe_dispatcher_set_active (GstProbeDispatcher * disp,
gboolean active);
void gst_probe_dispatcher_add_probe (GstProbeDispatcher * disp,
GstProbe * probe);
void gst_probe_dispatcher_remove_probe (GstProbeDispatcher * disp,
GstProbe * probe);
void gst_probe_dispatcher_set_active (GstProbeDispatcher *disp, gboolean active);
void gst_probe_dispatcher_add_probe (GstProbeDispatcher *disp, GstProbe *probe);
void gst_probe_dispatcher_remove_probe (GstProbeDispatcher *disp, GstProbe *probe);
gboolean gst_probe_dispatcher_dispatch (GstProbeDispatcher * disp,
GstData ** data);
gboolean gst_probe_dispatcher_dispatch (GstProbeDispatcher *disp, GstData **data);
G_END_DECLS
#endif /* __GST_PAD_H__ */

View file

@ -26,8 +26,9 @@
#include <glib.h>
G_BEGIN_DECLS typedef enum
{
G_BEGIN_DECLS
typedef enum {
GST_QUERY_NONE = 0,
GST_QUERY_TOTAL,
GST_QUERY_POSITION,
@ -36,8 +37,7 @@ G_BEGIN_DECLS typedef enum
GST_QUERY_START,
GST_QUERY_SEGMENT_END,
GST_QUERY_RATE
}
GstQueryType;
} GstQueryType;
/* rate is relative to 1000000 */
#define GST_QUERY_TYPE_RATE_DEN G_GINT64_CONSTANT (1000000)
@ -46,9 +46,9 @@ typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition;
struct _GstQueryTypeDefinition
{
GstQueryType value;
gchar *nick;
gchar *description;
GstQueryType value;
gchar *nick;
gchar *description;
};
#ifdef G_HAVE_ISO_VARARGS
@ -75,21 +75,22 @@ functionname (type object) \
}
#endif
void _gst_query_type_initialize (void);
void _gst_query_type_initialize (void);
/* register a new query */
GstQueryType gst_query_type_register (const gchar * nick,
const gchar * description);
GstQueryType gst_query_type_get_by_nick (const gchar * nick);
GstQueryType gst_query_type_register (const gchar *nick,
const gchar *description);
GstQueryType gst_query_type_get_by_nick (const gchar *nick);
/* check if a query is in an array of querys */
gboolean gst_query_types_contains (const GstQueryType * types,
GstQueryType type);
gboolean gst_query_types_contains (const GstQueryType *types, GstQueryType type);
/* query for query details */
G_CONST_RETURN GstQueryTypeDefinition *gst_query_type_get_details (GstQueryType
type);
G_CONST_RETURN GList *gst_query_type_get_definitions (void);
G_CONST_RETURN GstQueryTypeDefinition*
gst_query_type_get_details (GstQueryType type);
G_CONST_RETURN GList* gst_query_type_get_definitions (void);
G_END_DECLS
#endif /* __GST_QUERY_H__ */

View file

@ -29,6 +29,7 @@
G_BEGIN_DECLS
#define GST_TYPE_QUEUE \
(gst_queue_get_type())
#define GST_QUEUE(obj) \
@ -39,18 +40,17 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QUEUE))
#define GST_IS_QUEUE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QUEUE))
enum
{
GST_QUEUE_NO_LEAK = 0,
GST_QUEUE_LEAK_UPSTREAM = 1,
GST_QUEUE_LEAK_DOWNSTREAM = 2
enum {
GST_QUEUE_NO_LEAK = 0,
GST_QUEUE_LEAK_UPSTREAM = 1,
GST_QUEUE_LEAK_DOWNSTREAM = 2
};
typedef struct _GstQueue GstQueue;
typedef struct _GstQueueClass GstQueueClass;
struct _GstQueue
{
struct _GstQueue {
GstElement element;
GstPad *sinkpad;
@ -59,15 +59,13 @@ struct _GstQueue
/* the queue of data we're keeping our grubby hands on */
GQueue *queue;
struct
{
guint buffers; /* no. of buffers */
guint bytes; /* no. of bytes */
guint64 time; /* amount of time */
}
cur_level, /* currently in the queue */
max_size, /* max. amount of data allowed in the queue */
min_threshold; /* min. amount of data required to wake reader */
struct {
guint buffers; /* no. of buffers */
guint bytes; /* no. of bytes */
guint64 time; /* amount of time */
} cur_level, /* currently in the queue */
max_size, /* max. amount of data allowed in the queue */
min_threshold; /* min. amount of data required to wake reader */
/* whether we leak data, and at which end */
gint leaky;
@ -82,28 +80,27 @@ struct _GstQueue
gboolean interrupt;
gboolean flush;
GMutex *qlock; /* lock for queue (vs object lock) */
GCond *item_add; /* signals buffers now available for reading */
GCond *item_del; /* signals space now available for writing */
GCond *event_done; /* upstream event signaller */
GMutex *qlock; /* lock for queue (vs object lock) */
GCond *item_add; /* signals buffers now available for reading */
GCond *item_del; /* signals space now available for writing */
GCond *event_done; /* upstream event signaller */
GTimeVal *timeval; /* the timeout for the queue locking */
GQueue *events; /* upstream events get decoupled here */
GTimeVal *timeval; /* the timeout for the queue locking */
GQueue *events; /* upstream events get decoupled here */
GstCaps *negotiated_caps;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstQueueClass
{
struct _GstQueueClass {
GstElementClass parent_class;
/* signals - 'running' is called from both sides
* which might make it sort of non-useful... */
void (*underrun) (GstQueue * queue);
void (*running) (GstQueue * queue);
void (*overrun) (GstQueue * queue);
void (*underrun) (GstQueue *queue);
void (*running) (GstQueue *queue);
void (*overrun) (GstQueue *queue);
gpointer _gst_reserved[GST_PADDING];
};
@ -111,4 +108,6 @@ struct _GstQueueClass
GType gst_queue_get_type (void);
G_END_DECLS
#endif /* __GST_QUEUE_H__ */

View file

@ -43,25 +43,23 @@
S_IRGRP | S_IWGRP | \
S_IROTH | S_IWOTH)
G_BEGIN_DECLS typedef enum
{
GST_REGISTRY_OK = (0),
GST_REGISTRY_LOAD_ERROR = (1 << 1),
GST_REGISTRY_SAVE_ERROR = (1 << 2),
GST_REGISTRY_PLUGIN_LOAD_ERROR = (1 << 3),
GST_REGISTRY_PLUGIN_SIGNATURE_ERROR = (1 << 4)
}
GstRegistryReturn;
G_BEGIN_DECLS
typedef enum
{
GST_REGISTRY_READABLE = (1 << 1),
GST_REGISTRY_WRITABLE = (1 << 2),
GST_REGISTRY_EXISTS = (1 << 3),
GST_REGISTRY_REMOTE = (1 << 4),
GST_REGISTRY_DELAYED_LOADING = (1 << 5)
}
GstRegistryFlags;
typedef enum {
GST_REGISTRY_OK = (0),
GST_REGISTRY_LOAD_ERROR = (1 << 1),
GST_REGISTRY_SAVE_ERROR = (1 << 2),
GST_REGISTRY_PLUGIN_LOAD_ERROR = (1 << 3),
GST_REGISTRY_PLUGIN_SIGNATURE_ERROR = (1 << 4)
} GstRegistryReturn;
typedef enum {
GST_REGISTRY_READABLE = (1 << 1),
GST_REGISTRY_WRITABLE = (1 << 2),
GST_REGISTRY_EXISTS = (1 << 3),
GST_REGISTRY_REMOTE = (1 << 4),
GST_REGISTRY_DELAYED_LOADING = (1 << 5)
} GstRegistryFlags;
#define GST_TYPE_REGISTRY (gst_registry_get_type ())
@ -74,80 +72,75 @@ GstRegistryFlags;
typedef struct _GstRegistry GstRegistry;
typedef struct _GstRegistryClass GstRegistryClass;
struct _GstRegistry
{
GObject object;
struct _GstRegistry {
GObject object;
gint priority;
gint priority;
GstRegistryFlags flags;
gchar *name;
gchar *details;
gchar *name;
gchar *details;
gboolean loaded;
GList *plugins;
gboolean loaded;
GList *plugins;
GList *paths;
GList *paths;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstRegistryClass
{
GObjectClass parent_class;
struct _GstRegistryClass {
GObjectClass parent_class;
/* vtable */
gboolean (*load) (GstRegistry * registry);
gboolean (*save) (GstRegistry * registry);
gboolean (*rebuild) (GstRegistry * registry);
gboolean (*unload) (GstRegistry * registry);
gboolean (*load) (GstRegistry *registry);
gboolean (*save) (GstRegistry *registry);
gboolean (*rebuild) (GstRegistry *registry);
gboolean (*unload) (GstRegistry *registry);
GstRegistryReturn (*load_plugin) (GstRegistry * registry,
GstPlugin * plugin);
GstRegistryReturn (*unload_plugin) (GstRegistry * registry,
GstPlugin * plugin);
GstRegistryReturn (*update_plugin) (GstRegistry * registry,
GstPlugin * plugin);
GstRegistryReturn (*load_plugin) (GstRegistry *registry, GstPlugin *plugin);
GstRegistryReturn (*unload_plugin) (GstRegistry *registry, GstPlugin *plugin);
GstRegistryReturn (*update_plugin) (GstRegistry *registry, GstPlugin *plugin);
/* signals */
void (*plugin_added) (GstRegistry * registry, GstPlugin * plugin);
void (*plugin_added) (GstRegistry *registry, GstPlugin *plugin);
gpointer _gst_reserved[GST_PADDING];
};
/* normal GObject stuff */
GType gst_registry_get_type (void);
GType gst_registry_get_type (void);
gboolean gst_registry_load (GstRegistry * registry);
gboolean gst_registry_is_loaded (GstRegistry * registry);
gboolean gst_registry_save (GstRegistry * registry);
gboolean gst_registry_rebuild (GstRegistry * registry);
gboolean gst_registry_unload (GstRegistry * registry);
gboolean gst_registry_load (GstRegistry *registry);
gboolean gst_registry_is_loaded (GstRegistry *registry);
gboolean gst_registry_save (GstRegistry *registry);
gboolean gst_registry_rebuild (GstRegistry *registry);
gboolean gst_registry_unload (GstRegistry *registry);
void gst_registry_add_path (GstRegistry * registry, const gchar * path);
GList *gst_registry_get_path_list (GstRegistry * registry);
void gst_registry_clear_paths (GstRegistry * registry);
void gst_registry_add_path (GstRegistry *registry, const gchar *path);
GList* gst_registry_get_path_list (GstRegistry *registry);
void gst_registry_clear_paths (GstRegistry *registry);
gboolean gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin);
void gst_registry_remove_plugin (GstRegistry * registry, GstPlugin * plugin);
gboolean gst_registry_add_plugin (GstRegistry *registry, GstPlugin *plugin);
void gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin);
GList *gst_registry_plugin_filter (GstRegistry * registry,
GstPluginFilter filter, gboolean first, gpointer user_data);
GList *gst_registry_feature_filter (GstRegistry * registry,
GstPluginFeatureFilter filter, gboolean first, gpointer user_data);
GList* gst_registry_plugin_filter (GstRegistry *registry,
GstPluginFilter filter,
gboolean first,
gpointer user_data);
GList* gst_registry_feature_filter (GstRegistry *registry,
GstPluginFeatureFilter filter,
gboolean first,
gpointer user_data);
GstPlugin *gst_registry_find_plugin (GstRegistry * registry,
const gchar * name);
GstPluginFeature *gst_registry_find_feature (GstRegistry * registry,
const gchar * name, GType type);
GstPlugin* gst_registry_find_plugin (GstRegistry *registry, const gchar *name);
GstPluginFeature* gst_registry_find_feature (GstRegistry *registry, const gchar *name, GType type);
GstRegistryReturn gst_registry_load_plugin (GstRegistry * registry,
GstPlugin * plugin);
GstRegistryReturn gst_registry_unload_plugin (GstRegistry * registry,
GstPlugin * plugin);
GstRegistryReturn gst_registry_update_plugin (GstRegistry * registry,
GstPlugin * plugin);
GstRegistryReturn gst_registry_load_plugin (GstRegistry *registry, GstPlugin *plugin);
GstRegistryReturn gst_registry_unload_plugin (GstRegistry *registry, GstPlugin *plugin);
GstRegistryReturn gst_registry_update_plugin (GstRegistry *registry, GstPlugin *plugin);
G_END_DECLS
#endif /* __GST_REGISTRY_H__ */

View file

@ -25,33 +25,35 @@
#define __GST_REGISTRY_POOL_H__
G_BEGIN_DECLS
#include <gst/gstplugin.h>
#include <gst/gstregistry.h>
/* the pool of registries */
GList * gst_registry_pool_list (void);
GList* gst_registry_pool_list (void);
void gst_registry_pool_add (GstRegistry * registry, guint priority);
void gst_registry_pool_remove (GstRegistry * registry);
void gst_registry_pool_add (GstRegistry *registry, guint priority);
void gst_registry_pool_remove (GstRegistry *registry);
void gst_registry_pool_add_plugin (GstPlugin * plugin);
void gst_registry_pool_add_plugin (GstPlugin *plugin);
void gst_registry_pool_load_all (void);
void gst_registry_pool_load_all (void);
/* query the plugins/features */
GList *gst_registry_pool_plugin_filter (GstPluginFilter filter,
gboolean first, gpointer user_data);
GList *gst_registry_pool_feature_filter (GstPluginFeatureFilter filter,
gboolean first, gpointer user_data);
GList* gst_registry_pool_plugin_filter (GstPluginFilter filter,
gboolean first, gpointer user_data);
GList* gst_registry_pool_feature_filter (GstPluginFeatureFilter filter,
gboolean first, gpointer user_data);
/* some predefined filters */
GList *gst_registry_pool_plugin_list (void);
GList *gst_registry_pool_feature_list (GType type);
GList* gst_registry_pool_plugin_list (void);
GList* gst_registry_pool_feature_list (GType type);
GstPlugin *gst_registry_pool_find_plugin (const gchar * name);
GstPluginFeature *gst_registry_pool_find_feature (const gchar * name,
GType type);
GstPlugin* gst_registry_pool_find_plugin (const gchar *name);
GstPluginFeature* gst_registry_pool_find_feature (const gchar *name, GType type);
GstRegistry *gst_registry_pool_get_prefered (GstRegistryFlags flags);
GstRegistry* gst_registry_pool_get_prefered (GstRegistryFlags flags);
G_END_DECLS
#endif /* __GST_REGISTRY_POOL_H__ */

View file

@ -29,124 +29,114 @@
#include <gst/gstbin.h>
G_BEGIN_DECLS
#define GST_TYPE_SCHEDULER (gst_scheduler_get_type ())
#define GST_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SCHEDULER, GstScheduler))
#define GST_IS_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SCHEDULER))
#define GST_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SCHEDULER,GstSchedulerClass))
#define GST_IS_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SCHEDULER))
#define GST_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SCHEDULER, GstSchedulerClass))
typedef enum
{
typedef enum {
/* this scheduler works with a fixed clock */
GST_SCHEDULER_FLAG_FIXED_CLOCK = GST_OBJECT_FLAG_LAST,
GST_SCHEDULER_FLAG_FIXED_CLOCK = GST_OBJECT_FLAG_LAST,
/* padding */
GST_SCHEDULER_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4
}
GstSchedulerFlags;
GST_SCHEDULER_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4
} GstSchedulerFlags;
#define GST_SCHEDULER_PARENT(sched) ((sched)->parent)
#define GST_SCHEDULER_STATE(sched) ((sched)->state)
/*typedef struct _GstScheduler GstScheduler; */
/*typedef struct _GstSchedulerClass GstSchedulerClass; */
typedef enum
{
typedef enum {
GST_SCHEDULER_STATE_NONE,
GST_SCHEDULER_STATE_RUNNING,
GST_SCHEDULER_STATE_STOPPED,
GST_SCHEDULER_STATE_ERROR
}
GstSchedulerState;
} GstSchedulerState;
struct _GstScheduler
{
GstObject object;
struct _GstScheduler {
GstObject object;
GstElement *parent;
GstScheduler *parent_sched;
GstElement *parent;
GstScheduler *parent_sched;
GstSchedulerState state;
GstClock *clock;
GstClock *current_clock;
GstSchedulerState state;
GstClock *clock;
GstClock *current_clock;
GList *clock_providers;
GList *clock_receivers;
GList *clock_providers;
GList *clock_receivers;
GList *schedulers;
GList *schedulers;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstSchedulerClass
{
struct _GstSchedulerClass {
GstObjectClass parent_class;
/* virtual methods */
void (*setup) (GstScheduler * sched);
void (*reset) (GstScheduler * sched);
void (*add_element) (GstScheduler * sched, GstElement * element);
void (*remove_element) (GstScheduler * sched, GstElement * element);
void (*add_scheduler) (GstScheduler * sched, GstScheduler * sched2);
void (*remove_scheduler) (GstScheduler * sched, GstScheduler * sched2);
GstElementStateReturn (*state_transition) (GstScheduler * sched,
GstElement * element, gint transition);
void (*scheduling_change) (GstScheduler * sched, GstElement * element);
void (*lock_element) (GstScheduler * sched, GstElement * element);
void (*unlock_element) (GstScheduler * sched, GstElement * element);
gboolean (*yield) (GstScheduler * sched, GstElement * element);
gboolean (*interrupt) (GstScheduler * sched, GstElement * element);
void (*error) (GstScheduler * sched, GstElement * element);
void (*pad_link) (GstScheduler * sched, GstPad * srcpad, GstPad * sinkpad);
void (*pad_unlink) (GstScheduler * sched, GstPad * srcpad, GstPad * sinkpad);
void (*pad_select) (GstScheduler * sched, GList * padlist);
GstClockReturn (*clock_wait) (GstScheduler * sched, GstElement * element,
GstClockID id, GstClockTimeDiff * jitter);
GstSchedulerState (*iterate) (GstScheduler * sched);
void (*setup) (GstScheduler *sched);
void (*reset) (GstScheduler *sched);
void (*add_element) (GstScheduler *sched, GstElement *element);
void (*remove_element) (GstScheduler *sched, GstElement *element);
void (*add_scheduler) (GstScheduler *sched, GstScheduler *sched2);
void (*remove_scheduler) (GstScheduler *sched, GstScheduler *sched2);
GstElementStateReturn (*state_transition) (GstScheduler *sched, GstElement *element, gint transition);
void (*scheduling_change) (GstScheduler *sched, GstElement *element);
void (*lock_element) (GstScheduler *sched, GstElement *element);
void (*unlock_element) (GstScheduler *sched, GstElement *element);
gboolean (*yield) (GstScheduler *sched, GstElement *element);
gboolean (*interrupt) (GstScheduler *sched, GstElement *element);
void (*error) (GstScheduler *sched, GstElement *element);
void (*pad_link) (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
void (*pad_unlink) (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
void (*pad_select) (GstScheduler *sched, GList *padlist);
GstClockReturn (*clock_wait) (GstScheduler *sched, GstElement *element,
GstClockID id, GstClockTimeDiff *jitter);
GstSchedulerState (*iterate) (GstScheduler *sched);
/* for debugging */
void (*show) (GstScheduler * sched);
void (*show) (GstScheduler *sched);
/* signals */
void (*object_sync) (GstScheduler * sched, GstClock * clock,
GstObject * object, GstClockID id);
void (*object_sync) (GstScheduler *sched, GstClock *clock, GstObject *object,
GstClockID id);
gpointer _gst_reserved[GST_PADDING];
};
GType gst_scheduler_get_type (void);
GType gst_scheduler_get_type (void);
void gst_scheduler_setup (GstScheduler * sched);
void gst_scheduler_reset (GstScheduler * sched);
void gst_scheduler_add_element (GstScheduler * sched, GstElement * element);
void gst_scheduler_remove_element (GstScheduler * sched, GstElement * element);
void gst_scheduler_add_scheduler (GstScheduler * sched, GstScheduler * sched2);
void gst_scheduler_remove_scheduler (GstScheduler * sched,
GstScheduler * sched2);
GstElementStateReturn gst_scheduler_state_transition (GstScheduler * sched,
GstElement * element, gint transition);
void gst_scheduler_scheduling_change (GstScheduler * sched,
GstElement * element);
void gst_scheduler_lock_element (GstScheduler * sched, GstElement * element);
void gst_scheduler_unlock_element (GstScheduler * sched, GstElement * element);
gboolean gst_scheduler_yield (GstScheduler * sched, GstElement * element);
gboolean gst_scheduler_interrupt (GstScheduler * sched, GstElement * element);
void gst_scheduler_error (GstScheduler * sched, GstElement * element);
void gst_scheduler_pad_link (GstScheduler * sched, GstPad * srcpad,
GstPad * sinkpad);
void gst_scheduler_pad_unlink (GstScheduler * sched, GstPad * srcpad,
GstPad * sinkpad);
GstPad *gst_scheduler_pad_select (GstScheduler * sched, GList * padlist);
GstClockReturn gst_scheduler_clock_wait (GstScheduler * sched,
GstElement * element, GstClockID id, GstClockTimeDiff * jitter);
gboolean gst_scheduler_iterate (GstScheduler * sched);
void gst_scheduler_setup (GstScheduler *sched);
void gst_scheduler_reset (GstScheduler *sched);
void gst_scheduler_add_element (GstScheduler *sched, GstElement *element);
void gst_scheduler_remove_element (GstScheduler *sched, GstElement *element);
void gst_scheduler_add_scheduler (GstScheduler *sched, GstScheduler *sched2);
void gst_scheduler_remove_scheduler (GstScheduler *sched, GstScheduler *sched2);
GstElementStateReturn gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint transition);
void gst_scheduler_scheduling_change (GstScheduler *sched, GstElement *element);
void gst_scheduler_lock_element (GstScheduler *sched, GstElement *element);
void gst_scheduler_unlock_element (GstScheduler *sched, GstElement *element);
gboolean gst_scheduler_yield (GstScheduler *sched, GstElement *element);
gboolean gst_scheduler_interrupt (GstScheduler *sched, GstElement *element);
void gst_scheduler_error (GstScheduler *sched, GstElement *element);
void gst_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
void gst_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
GstPad* gst_scheduler_pad_select (GstScheduler *sched, GList *padlist);
GstClockReturn gst_scheduler_clock_wait (GstScheduler *sched, GstElement *element,
GstClockID id, GstClockTimeDiff *jitter);
gboolean gst_scheduler_iterate (GstScheduler *sched);
void gst_scheduler_use_clock (GstScheduler * sched, GstClock * clock);
void gst_scheduler_set_clock (GstScheduler * sched, GstClock * clock);
GstClock *gst_scheduler_get_clock (GstScheduler * sched);
void gst_scheduler_auto_clock (GstScheduler * sched);
void gst_scheduler_use_clock (GstScheduler *sched, GstClock *clock);
void gst_scheduler_set_clock (GstScheduler *sched, GstClock *clock);
GstClock* gst_scheduler_get_clock (GstScheduler *sched);
void gst_scheduler_auto_clock (GstScheduler *sched);
void gst_scheduler_show (GstScheduler * sched);
void gst_scheduler_show (GstScheduler *sched);
/*
* creating schedulers
@ -165,39 +155,35 @@ void gst_scheduler_show (GstScheduler * sched);
typedef struct _GstSchedulerFactory GstSchedulerFactory;
typedef struct _GstSchedulerFactoryClass GstSchedulerFactoryClass;
struct _GstSchedulerFactory
{
struct _GstSchedulerFactory {
GstPluginFeature feature;
gchar *longdesc; /* long description of the scheduler (well, don't overdo it..) */
GType type; /* unique GType of the scheduler */
gchar *longdesc; /* long description of the scheduler (well, don't overdo it..) */
GType type; /* unique GType of the scheduler */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstSchedulerFactoryClass
{
struct _GstSchedulerFactoryClass {
GstPluginFeatureClass parent;
gpointer _gst_reserved[GST_PADDING];
};
GType gst_scheduler_factory_get_type (void);
GType gst_scheduler_factory_get_type (void);
GstSchedulerFactory *gst_scheduler_factory_new (const gchar * name,
const gchar * longdesc, GType type);
void gst_scheduler_factory_destroy (GstSchedulerFactory * factory);
GstSchedulerFactory* gst_scheduler_factory_new (const gchar *name, const gchar *longdesc, GType type);
void gst_scheduler_factory_destroy (GstSchedulerFactory *factory);
GstSchedulerFactory *gst_scheduler_factory_find (const gchar * name);
GstSchedulerFactory* gst_scheduler_factory_find (const gchar *name);
GstScheduler *gst_scheduler_factory_create (GstSchedulerFactory * factory,
GstElement * parent);
GstScheduler *gst_scheduler_factory_make (const gchar * name,
GstElement * parent);
GstScheduler* gst_scheduler_factory_create (GstSchedulerFactory *factory, GstElement *parent);
GstScheduler* gst_scheduler_factory_make (const gchar *name, GstElement *parent);
void gst_scheduler_factory_set_default_name (const gchar * name);
G_CONST_RETURN gchar *gst_scheduler_factory_get_default_name (void);
void gst_scheduler_factory_set_default_name (const gchar* name);
G_CONST_RETURN gchar* gst_scheduler_factory_get_default_name (void);
G_END_DECLS
#endif /* __GST_SCHEDULER_H__ */

View file

@ -24,16 +24,18 @@
#include <glib-object.h>
G_BEGIN_DECLS
#define GST_TYPE_STRUCTURE (gst_structure_get_type ())
#define GST_STRUCTURE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GST_TYPE_STRUCTURE, GstStructure))
#define GST_IS_STRUCTURE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GST_TYPE_STRUCTURE))
typedef struct _GstStructure GstStructure;
typedef gboolean (*GstStructureForeachFunc) (GQuark field_id,
GValue * value, gpointer user_data);
typedef gboolean (*GstStructureForeachFunc) (GQuark field_id,
GValue * value,
gpointer user_data);
struct _GstStructure
{
struct _GstStructure {
GType type;
GQuark name;
@ -41,68 +43,82 @@ struct _GstStructure
GArray *fields;
};
GType
gst_structure_get_type (void)
G_GNUC_CONST;
GType gst_structure_get_type (void) G_GNUC_CONST;
GstStructure *gst_structure_empty_new (const gchar * name);
GstStructure *gst_structure_id_empty_new (GQuark quark);
GstStructure *gst_structure_new (const gchar * name,
const gchar * firstfield, ...);
GstStructure *gst_structure_new_valist (const gchar * name,
const gchar * firstfield, va_list varargs);
GstStructure *gst_structure_copy (const GstStructure * structure);
void gst_structure_free (GstStructure * structure);
GstStructure * gst_structure_empty_new (const gchar * name);
GstStructure * gst_structure_id_empty_new (GQuark quark);
GstStructure * gst_structure_new (const gchar * name,
const gchar * firstfield,
...);
GstStructure * gst_structure_new_valist (const gchar * name,
const gchar * firstfield,
va_list varargs);
GstStructure * gst_structure_copy (const GstStructure *structure);
void gst_structure_free (GstStructure *structure);
G_CONST_RETURN gchar *gst_structure_get_name (const GstStructure *
structure);
void gst_structure_set_name (GstStructure * structure, const gchar * name);
G_CONST_RETURN gchar * gst_structure_get_name (const GstStructure *structure);
void gst_structure_set_name (GstStructure *structure,
const gchar *name);
void gst_structure_id_set_value (GstStructure * structure,
GQuark field, const GValue * value);
void gst_structure_set_value (GstStructure * structure,
const gchar * fieldname, const GValue * value);
void gst_structure_set (GstStructure * structure,
const gchar * fieldname, ...);
void gst_structure_set_valist (GstStructure * structure,
const gchar * fieldname, va_list varargs);
G_CONST_RETURN GValue *gst_structure_id_get_value (const GstStructure *
structure, GQuark field);
G_CONST_RETURN GValue *gst_structure_get_value (const GstStructure *
structure, const gchar * fieldname);
void gst_structure_remove_field (GstStructure * structure,
const gchar * fieldname);
void gst_structure_remove_fields (GstStructure * structure,
const gchar * fieldname, ...);
void gst_structure_remove_fields_valist (GstStructure * structure,
const gchar * fieldname, va_list varargs);
void gst_structure_remove_all_fields (GstStructure * structure);
void gst_structure_id_set_value (GstStructure *structure,
GQuark field,
const GValue *value);
void gst_structure_set_value (GstStructure *structure,
const gchar *fieldname,
const GValue *value);
void gst_structure_set (GstStructure *structure,
const gchar *fieldname,
...);
void gst_structure_set_valist (GstStructure *structure,
const gchar *fieldname,
va_list varargs);
G_CONST_RETURN GValue * gst_structure_id_get_value (const GstStructure *structure,
GQuark field);
G_CONST_RETURN GValue * gst_structure_get_value (const GstStructure *structure,
const gchar *fieldname);
void gst_structure_remove_field (GstStructure *structure,
const gchar *fieldname);
void gst_structure_remove_fields (GstStructure *structure,
const gchar *fieldname,
...);
void gst_structure_remove_fields_valist (GstStructure *structure,
const gchar *fieldname,
va_list varargs);
void gst_structure_remove_all_fields (GstStructure *structure);
GType gst_structure_get_field_type (const GstStructure * structure,
const gchar * fieldname);
gboolean gst_structure_foreach (GstStructure * structure,
GstStructureForeachFunc func, gpointer user_data);
gint gst_structure_n_fields (const GstStructure * structure);
gboolean gst_structure_has_field (const GstStructure * structure,
const gchar * fieldname);
gboolean gst_structure_has_field_typed (const GstStructure * structure,
const gchar * fieldname, GType type);
GType gst_structure_get_field_type (const GstStructure *structure,
const gchar *fieldname);
gboolean gst_structure_foreach (GstStructure *structure,
GstStructureForeachFunc func,
gpointer user_data);
gint gst_structure_n_fields (const GstStructure *structure);
gboolean gst_structure_has_field (const GstStructure *structure,
const gchar *fieldname);
gboolean gst_structure_has_field_typed (const GstStructure *structure,
const gchar *fieldname,
GType type);
/* utility functions */
gboolean gst_structure_get_boolean (const GstStructure * structure,
const gchar * fieldname, gboolean * value);
gboolean gst_structure_get_int (const GstStructure * structure,
const gchar * fieldname, gint * value);
gboolean gst_structure_get_fourcc (const GstStructure * structure,
const gchar * fieldname, guint32 * value);
gboolean gst_structure_get_double (const GstStructure * structure,
const gchar * fieldname, gdouble * value);
G_CONST_RETURN gchar *gst_structure_get_string (const GstStructure *
structure, const gchar * fieldname);
gboolean gst_structure_get_boolean (const GstStructure *structure,
const gchar *fieldname,
gboolean *value);
gboolean gst_structure_get_int (const GstStructure *structure,
const gchar *fieldname,
gint *value);
gboolean gst_structure_get_fourcc (const GstStructure *structure,
const gchar *fieldname,
guint32 *value);
gboolean gst_structure_get_double (const GstStructure *structure,
const gchar *fieldname,
gdouble *value);
G_CONST_RETURN gchar * gst_structure_get_string (const GstStructure *structure,
const gchar *fieldname);
gchar *gst_structure_to_string (const GstStructure * structure);
GstStructure *gst_structure_from_string (const gchar * string,
gchar ** end);
gchar * gst_structure_to_string (const GstStructure *structure);
GstStructure * gst_structure_from_string (const gchar *string,
gchar **end);
G_END_DECLS
#endif

View file

@ -27,35 +27,37 @@
#include <gst/gstclock.h>
G_BEGIN_DECLS
#define GST_TYPE_SYSTEM_CLOCK (gst_system_clock_get_type ())
#define GST_SYSTEM_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SYSTEM_CLOCK, GstSystemClock))
#define GST_IS_SYSTEM_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SYSTEM_CLOCK))
#define GST_SYSTEM_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SYSTEM_CLOCK, GstSystemClockClass))
#define GST_IS_SYSTEM_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SYSTEM_CLOCK))
#define GST_SYSTEM_CLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SYSTEM_CLOCK, GstSystemClockClass))
typedef struct _GstSystemClock GstSystemClock;
typedef struct _GstSystemClockClass GstSystemClockClass;
struct _GstSystemClock
{
GstClock clock;
struct _GstSystemClock {
GstClock clock;
GMutex *mutex;
GCond *cond;
GMutex * mutex;
GCond * cond;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstSystemClockClass
{
GstClockClass parent_class;
struct _GstSystemClockClass {
GstClockClass parent_class;
gpointer _gst_reserved[GST_PADDING];
};
GType gst_system_clock_get_type (void);
GType gst_system_clock_get_type (void);
GstClock *gst_system_clock_obtain (void);
GstClock* gst_system_clock_obtain (void);
G_END_DECLS
#endif /* __GST_SYSTEM_CLOCK_H__ */

View file

@ -26,8 +26,9 @@
#include <gst/gststructure.h>
#include <gst/gstevent.h>
G_BEGIN_DECLS typedef enum
{
G_BEGIN_DECLS
typedef enum {
GST_TAG_MERGE_UNDEFINED,
GST_TAG_MERGE_REPLACE_ALL,
GST_TAG_MERGE_REPLACE,
@ -37,136 +38,191 @@ G_BEGIN_DECLS typedef enum
GST_TAG_MERGE_KEEP_ALL,
/* add more */
GST_TAG_MERGE_COUNT
}
GstTagMergeMode;
} GstTagMergeMode;
#define GST_TAG_MODE_IS_VALID(mode) (((mode) > GST_TAG_MERGE_UNDEFINED) && ((mode) < GST_TAG_MERGE_COUNT))
typedef enum
{
typedef enum {
GST_TAG_FLAG_UNDEFINED,
GST_TAG_FLAG_META,
GST_TAG_FLAG_ENCODED,
GST_TAG_FLAG_DECODED,
GST_TAG_FLAG_COUNT
}
GstTagFlag;
} GstTagFlag;
#define GST_TAG_FLAG_IS_VALID(flag) (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))
typedef GstStructure GstTagList;
#define GST_TAG_LIST(x) ((GstTagList *) (x))
#define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
#define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
typedef void (*GstTagForeachFunc) (const GstTagList * list, const gchar * tag,
gpointer user_data);
typedef void (*GstTagMergeFunc) (GValue * dest, const GValue * src);
typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data);
typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
/* initialize tagging system */
void _gst_tag_initialize (void);
GType gst_tag_list_get_type (void);
void _gst_tag_initialize (void);
GType gst_tag_list_get_type (void);
void gst_tag_register (gchar * name,
GstTagFlag flag,
GType type, gchar * nick, gchar * blurb, GstTagMergeFunc func);
void gst_tag_register (gchar * name,
GstTagFlag flag,
GType type,
gchar * nick,
gchar * blurb,
GstTagMergeFunc func);
/* some default merging functions */
void gst_tag_merge_use_first (GValue * dest, const GValue * src);
void gst_tag_merge_strings_with_comma (GValue * dest, const GValue * src);
void gst_tag_merge_use_first (GValue * dest,
const GValue * src);
void gst_tag_merge_strings_with_comma (GValue * dest,
const GValue * src);
/* basic tag support */
gboolean gst_tag_exists (const gchar * tag);
GType gst_tag_get_type (const gchar * tag);
G_CONST_RETURN gchar *gst_tag_get_nick (const gchar * tag);
G_CONST_RETURN gchar *gst_tag_get_description (const gchar * tag);
GstTagFlag gst_tag_get_flag (const gchar * tag);
gboolean gst_tag_is_fixed (const gchar * tag);
gboolean gst_tag_exists (const gchar * tag);
GType gst_tag_get_type (const gchar * tag);
G_CONST_RETURN gchar *
gst_tag_get_nick (const gchar * tag);
G_CONST_RETURN gchar *
gst_tag_get_description (const gchar * tag);
GstTagFlag gst_tag_get_flag (const gchar * tag);
gboolean gst_tag_is_fixed (const gchar * tag);
/* tag lists */
GstTagList *gst_tag_list_new (void);
gboolean gst_is_tag_list (gconstpointer p);
GstTagList *gst_tag_list_copy (const GstTagList * list);
void gst_tag_list_insert (GstTagList * into,
const GstTagList * from, GstTagMergeMode mode);
GstTagList *gst_tag_list_merge (const GstTagList * list1,
const GstTagList * list2, GstTagMergeMode mode);
void gst_tag_list_free (GstTagList * list);
guint gst_tag_list_get_tag_size (const GstTagList * list, const gchar * tag);
void gst_tag_list_add (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_list_add_values (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_list_add_valist (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_list_add_valist_values (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_list_remove_tag (GstTagList * list, const gchar * tag);
void gst_tag_list_foreach (GstTagList * list,
GstTagForeachFunc func, gpointer user_data);
GstTagList * gst_tag_list_new (void);
gboolean gst_is_tag_list (gconstpointer p);
GstTagList * gst_tag_list_copy (const GstTagList * list);
void gst_tag_list_insert (GstTagList * into,
const GstTagList * from,
GstTagMergeMode mode);
GstTagList * gst_tag_list_merge (const GstTagList * list1,
const GstTagList * list2,
GstTagMergeMode mode);
void gst_tag_list_free (GstTagList * list);
guint gst_tag_list_get_tag_size (const GstTagList * list,
const gchar * tag);
void gst_tag_list_add (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_list_add_values (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_list_add_valist (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
void gst_tag_list_add_valist_values (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
void gst_tag_list_remove_tag (GstTagList * list,
const gchar * tag);
void gst_tag_list_foreach (GstTagList * list,
GstTagForeachFunc func,
gpointer user_data);
G_CONST_RETURN GValue *gst_tag_list_get_value_index (const GstTagList * list,
const gchar * tag, guint index);
gboolean gst_tag_list_copy_value (GValue * dest,
const GstTagList * list, const gchar * tag);
G_CONST_RETURN GValue *
gst_tag_list_get_value_index (const GstTagList * list,
const gchar * tag,
guint index);
gboolean gst_tag_list_copy_value (GValue * dest,
const GstTagList * list,
const gchar * tag);
/* simplifications (FIXME: do we want them?) */
gboolean gst_tag_list_get_char (const GstTagList * list,
const gchar * tag, gchar * value);
gboolean gst_tag_list_get_char_index (const GstTagList * list,
const gchar * tag, guint index, gchar * value);
gboolean gst_tag_list_get_uchar (const GstTagList * list,
const gchar * tag, guchar * value);
gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
const gchar * tag, guint index, guchar * value);
gboolean gst_tag_list_get_boolean (const GstTagList * list,
const gchar * tag, gboolean * value);
gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
const gchar * tag, guint index, gboolean * value);
gboolean gst_tag_list_get_int (const GstTagList * list,
const gchar * tag, gint * value);
gboolean gst_tag_list_get_int_index (const GstTagList * list,
const gchar * tag, guint index, gint * value);
gboolean gst_tag_list_get_uint (const GstTagList * list,
const gchar * tag, guint * value);
gboolean gst_tag_list_get_uint_index (const GstTagList * list,
const gchar * tag, guint index, guint * value);
gboolean gst_tag_list_get_long (const GstTagList * list,
const gchar * tag, glong * value);
gboolean gst_tag_list_get_long_index (const GstTagList * list,
const gchar * tag, guint index, glong * value);
gboolean gst_tag_list_get_ulong (const GstTagList * list,
const gchar * tag, gulong * value);
gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
const gchar * tag, guint index, gulong * value);
gboolean gst_tag_list_get_int64 (const GstTagList * list,
const gchar * tag, gint64 * value);
gboolean gst_tag_list_get_int64_index (const GstTagList * list,
const gchar * tag, guint index, gint64 * value);
gboolean gst_tag_list_get_uint64 (const GstTagList * list,
const gchar * tag, guint64 * value);
gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
const gchar * tag, guint index, guint64 * value);
gboolean gst_tag_list_get_float (const GstTagList * list,
const gchar * tag, gfloat * value);
gboolean gst_tag_list_get_float_index (const GstTagList * list,
const gchar * tag, guint index, gfloat * value);
gboolean gst_tag_list_get_double (const GstTagList * list,
const gchar * tag, gdouble * value);
gboolean gst_tag_list_get_double_index (const GstTagList * list,
const gchar * tag, guint index, gdouble * value);
gboolean gst_tag_list_get_string (const GstTagList * list,
const gchar * tag, gchar ** value);
gboolean gst_tag_list_get_string_index (const GstTagList * list,
const gchar * tag, guint index, gchar ** value);
gboolean gst_tag_list_get_pointer (const GstTagList * list,
const gchar * tag, gpointer * value);
gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
const gchar * tag, guint index, gpointer * value);
gboolean gst_tag_list_get_char (const GstTagList * list,
const gchar * tag,
gchar * value);
gboolean gst_tag_list_get_char_index (const GstTagList * list,
const gchar * tag,
guint index,
gchar * value);
gboolean gst_tag_list_get_uchar (const GstTagList * list,
const gchar * tag,
guchar * value);
gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
const gchar * tag,
guint index,
guchar * value);
gboolean gst_tag_list_get_boolean (const GstTagList * list,
const gchar * tag,
gboolean * value);
gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
const gchar * tag,
guint index,
gboolean * value);
gboolean gst_tag_list_get_int (const GstTagList * list,
const gchar * tag,
gint * value);
gboolean gst_tag_list_get_int_index (const GstTagList * list,
const gchar * tag,
guint index,
gint * value);
gboolean gst_tag_list_get_uint (const GstTagList * list,
const gchar * tag,
guint * value);
gboolean gst_tag_list_get_uint_index (const GstTagList * list,
const gchar * tag,
guint index,
guint * value);
gboolean gst_tag_list_get_long (const GstTagList * list,
const gchar * tag,
glong * value);
gboolean gst_tag_list_get_long_index (const GstTagList * list,
const gchar * tag,
guint index,
glong * value);
gboolean gst_tag_list_get_ulong (const GstTagList * list,
const gchar * tag,
gulong * value);
gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
const gchar * tag,
guint index,
gulong * value);
gboolean gst_tag_list_get_int64 (const GstTagList * list,
const gchar * tag,
gint64 * value);
gboolean gst_tag_list_get_int64_index (const GstTagList * list,
const gchar * tag,
guint index,
gint64 * value);
gboolean gst_tag_list_get_uint64 (const GstTagList * list,
const gchar * tag,
guint64 * value);
gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
const gchar * tag,
guint index,
guint64 * value);
gboolean gst_tag_list_get_float (const GstTagList * list,
const gchar * tag,
gfloat * value);
gboolean gst_tag_list_get_float_index (const GstTagList * list,
const gchar * tag,
guint index,
gfloat * value);
gboolean gst_tag_list_get_double (const GstTagList * list,
const gchar * tag,
gdouble * value);
gboolean gst_tag_list_get_double_index (const GstTagList * list,
const gchar * tag,
guint index,
gdouble * value);
gboolean gst_tag_list_get_string (const GstTagList * list,
const gchar * tag,
gchar ** value);
gboolean gst_tag_list_get_string_index (const GstTagList * list,
const gchar * tag,
guint index,
gchar ** value);
gboolean gst_tag_list_get_pointer (const GstTagList * list,
const gchar * tag,
gpointer * value);
gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
const gchar * tag,
guint index,
gpointer * value);
/* tag events */
GstEvent *gst_event_new_tag (GstTagList * list);
GstTagList *gst_event_tag_get_list (GstEvent * tag_event);
GstEvent * gst_event_new_tag (GstTagList * list);
GstTagList * gst_event_tag_get_list (GstEvent * tag_event);
/* GStreamer core tags (need to be discussed) */
@ -206,4 +262,5 @@ GstTagList *gst_event_tag_get_list (GstEvent * tag_event);
#define GST_TAG_ALBUM_PEAK "replaygain-album-peak"
G_END_DECLS
#endif /* __GST_EVENT_H__ */

View file

@ -25,13 +25,15 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_TAG_SETTER (gst_tag_setter_get_type ())
#define GST_TAG_SETTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TAG_SETTER, GstTagSetter))
#define GST_TAG_SETTER_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GST_TYPE_TAG_SETTER, GstTagSetter))
#define GST_IS_TAG_SETTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TAG_SETTER))
#define GST_TAG_SETTER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_TAG_SETTER, GstTagSetterIFace))
typedef struct _GstTagSetter GstTagSetter; /* Dummy typedef */
typedef struct _GstTagSetterIFace GstTagSetterIFace;
typedef struct _GstTagSetter GstTagSetter; /* Dummy typedef */
typedef struct _GstTagSetterIFace GstTagSetterIFace;
/* use an empty interface here to allow detection of elements using user-set
tags */
@ -44,29 +46,38 @@ struct _GstTagSetterIFace
/* virtual table */
};
GType
gst_tag_setter_get_type (void)
G_GNUC_CONST;
GType gst_tag_setter_get_type (void) G_GNUC_CONST;
void gst_tag_setter_merge (GstTagSetter * setter,
const GstTagList * list, GstTagMergeMode mode);
void gst_tag_setter_add (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_setter_merge (GstTagSetter * setter,
const GstTagList * list,
GstTagMergeMode mode);
void gst_tag_setter_add (GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_setter_add_values (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_setter_add_values (GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_setter_add_valist (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_setter_add_valist (GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
void gst_tag_setter_add_valist_values (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_setter_add_valist_values(GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
G_CONST_RETURN GstTagList *gst_tag_setter_get_list (GstTagSetter * setter);
G_CONST_RETURN GstTagList *
gst_tag_setter_get_list (GstTagSetter * setter);
void gst_tag_setter_set_merge_mode (GstTagSetter * setter,
GstTagMergeMode mode);
GstTagMergeMode gst_tag_setter_get_merge_mode (GstTagSetter * setter);
void gst_tag_setter_set_merge_mode (GstTagSetter * setter,
GstTagMergeMode mode);
GstTagMergeMode gst_tag_setter_get_merge_mode (GstTagSetter * setter);
G_END_DECLS
#endif /* __GST_TAG_INTERFACE_H__ */

View file

@ -26,8 +26,9 @@
#include <gst/gststructure.h>
#include <gst/gstevent.h>
G_BEGIN_DECLS typedef enum
{
G_BEGIN_DECLS
typedef enum {
GST_TAG_MERGE_UNDEFINED,
GST_TAG_MERGE_REPLACE_ALL,
GST_TAG_MERGE_REPLACE,
@ -37,136 +38,191 @@ G_BEGIN_DECLS typedef enum
GST_TAG_MERGE_KEEP_ALL,
/* add more */
GST_TAG_MERGE_COUNT
}
GstTagMergeMode;
} GstTagMergeMode;
#define GST_TAG_MODE_IS_VALID(mode) (((mode) > GST_TAG_MERGE_UNDEFINED) && ((mode) < GST_TAG_MERGE_COUNT))
typedef enum
{
typedef enum {
GST_TAG_FLAG_UNDEFINED,
GST_TAG_FLAG_META,
GST_TAG_FLAG_ENCODED,
GST_TAG_FLAG_DECODED,
GST_TAG_FLAG_COUNT
}
GstTagFlag;
} GstTagFlag;
#define GST_TAG_FLAG_IS_VALID(flag) (((flag) > GST_TAG_FLAG_UNDEFINED) && ((flag) < GST_TAG_FLAG_COUNT))
typedef GstStructure GstTagList;
#define GST_TAG_LIST(x) ((GstTagList *) (x))
#define GST_IS_TAG_LIST(x) (gst_is_tag_list (GST_TAG_LIST (x)))
#define GST_TYPE_TAG_LIST (gst_tag_list_get_type ())
typedef void (*GstTagForeachFunc) (const GstTagList * list, const gchar * tag,
gpointer user_data);
typedef void (*GstTagMergeFunc) (GValue * dest, const GValue * src);
typedef void (* GstTagForeachFunc) (const GstTagList *list, const gchar *tag, gpointer user_data);
typedef void (* GstTagMergeFunc) (GValue *dest, const GValue *src);
/* initialize tagging system */
void _gst_tag_initialize (void);
GType gst_tag_list_get_type (void);
void _gst_tag_initialize (void);
GType gst_tag_list_get_type (void);
void gst_tag_register (gchar * name,
GstTagFlag flag,
GType type, gchar * nick, gchar * blurb, GstTagMergeFunc func);
void gst_tag_register (gchar * name,
GstTagFlag flag,
GType type,
gchar * nick,
gchar * blurb,
GstTagMergeFunc func);
/* some default merging functions */
void gst_tag_merge_use_first (GValue * dest, const GValue * src);
void gst_tag_merge_strings_with_comma (GValue * dest, const GValue * src);
void gst_tag_merge_use_first (GValue * dest,
const GValue * src);
void gst_tag_merge_strings_with_comma (GValue * dest,
const GValue * src);
/* basic tag support */
gboolean gst_tag_exists (const gchar * tag);
GType gst_tag_get_type (const gchar * tag);
G_CONST_RETURN gchar *gst_tag_get_nick (const gchar * tag);
G_CONST_RETURN gchar *gst_tag_get_description (const gchar * tag);
GstTagFlag gst_tag_get_flag (const gchar * tag);
gboolean gst_tag_is_fixed (const gchar * tag);
gboolean gst_tag_exists (const gchar * tag);
GType gst_tag_get_type (const gchar * tag);
G_CONST_RETURN gchar *
gst_tag_get_nick (const gchar * tag);
G_CONST_RETURN gchar *
gst_tag_get_description (const gchar * tag);
GstTagFlag gst_tag_get_flag (const gchar * tag);
gboolean gst_tag_is_fixed (const gchar * tag);
/* tag lists */
GstTagList *gst_tag_list_new (void);
gboolean gst_is_tag_list (gconstpointer p);
GstTagList *gst_tag_list_copy (const GstTagList * list);
void gst_tag_list_insert (GstTagList * into,
const GstTagList * from, GstTagMergeMode mode);
GstTagList *gst_tag_list_merge (const GstTagList * list1,
const GstTagList * list2, GstTagMergeMode mode);
void gst_tag_list_free (GstTagList * list);
guint gst_tag_list_get_tag_size (const GstTagList * list, const gchar * tag);
void gst_tag_list_add (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_list_add_values (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_list_add_valist (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_list_add_valist_values (GstTagList * list,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_list_remove_tag (GstTagList * list, const gchar * tag);
void gst_tag_list_foreach (GstTagList * list,
GstTagForeachFunc func, gpointer user_data);
GstTagList * gst_tag_list_new (void);
gboolean gst_is_tag_list (gconstpointer p);
GstTagList * gst_tag_list_copy (const GstTagList * list);
void gst_tag_list_insert (GstTagList * into,
const GstTagList * from,
GstTagMergeMode mode);
GstTagList * gst_tag_list_merge (const GstTagList * list1,
const GstTagList * list2,
GstTagMergeMode mode);
void gst_tag_list_free (GstTagList * list);
guint gst_tag_list_get_tag_size (const GstTagList * list,
const gchar * tag);
void gst_tag_list_add (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_list_add_values (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_list_add_valist (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
void gst_tag_list_add_valist_values (GstTagList * list,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
void gst_tag_list_remove_tag (GstTagList * list,
const gchar * tag);
void gst_tag_list_foreach (GstTagList * list,
GstTagForeachFunc func,
gpointer user_data);
G_CONST_RETURN GValue *gst_tag_list_get_value_index (const GstTagList * list,
const gchar * tag, guint index);
gboolean gst_tag_list_copy_value (GValue * dest,
const GstTagList * list, const gchar * tag);
G_CONST_RETURN GValue *
gst_tag_list_get_value_index (const GstTagList * list,
const gchar * tag,
guint index);
gboolean gst_tag_list_copy_value (GValue * dest,
const GstTagList * list,
const gchar * tag);
/* simplifications (FIXME: do we want them?) */
gboolean gst_tag_list_get_char (const GstTagList * list,
const gchar * tag, gchar * value);
gboolean gst_tag_list_get_char_index (const GstTagList * list,
const gchar * tag, guint index, gchar * value);
gboolean gst_tag_list_get_uchar (const GstTagList * list,
const gchar * tag, guchar * value);
gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
const gchar * tag, guint index, guchar * value);
gboolean gst_tag_list_get_boolean (const GstTagList * list,
const gchar * tag, gboolean * value);
gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
const gchar * tag, guint index, gboolean * value);
gboolean gst_tag_list_get_int (const GstTagList * list,
const gchar * tag, gint * value);
gboolean gst_tag_list_get_int_index (const GstTagList * list,
const gchar * tag, guint index, gint * value);
gboolean gst_tag_list_get_uint (const GstTagList * list,
const gchar * tag, guint * value);
gboolean gst_tag_list_get_uint_index (const GstTagList * list,
const gchar * tag, guint index, guint * value);
gboolean gst_tag_list_get_long (const GstTagList * list,
const gchar * tag, glong * value);
gboolean gst_tag_list_get_long_index (const GstTagList * list,
const gchar * tag, guint index, glong * value);
gboolean gst_tag_list_get_ulong (const GstTagList * list,
const gchar * tag, gulong * value);
gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
const gchar * tag, guint index, gulong * value);
gboolean gst_tag_list_get_int64 (const GstTagList * list,
const gchar * tag, gint64 * value);
gboolean gst_tag_list_get_int64_index (const GstTagList * list,
const gchar * tag, guint index, gint64 * value);
gboolean gst_tag_list_get_uint64 (const GstTagList * list,
const gchar * tag, guint64 * value);
gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
const gchar * tag, guint index, guint64 * value);
gboolean gst_tag_list_get_float (const GstTagList * list,
const gchar * tag, gfloat * value);
gboolean gst_tag_list_get_float_index (const GstTagList * list,
const gchar * tag, guint index, gfloat * value);
gboolean gst_tag_list_get_double (const GstTagList * list,
const gchar * tag, gdouble * value);
gboolean gst_tag_list_get_double_index (const GstTagList * list,
const gchar * tag, guint index, gdouble * value);
gboolean gst_tag_list_get_string (const GstTagList * list,
const gchar * tag, gchar ** value);
gboolean gst_tag_list_get_string_index (const GstTagList * list,
const gchar * tag, guint index, gchar ** value);
gboolean gst_tag_list_get_pointer (const GstTagList * list,
const gchar * tag, gpointer * value);
gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
const gchar * tag, guint index, gpointer * value);
gboolean gst_tag_list_get_char (const GstTagList * list,
const gchar * tag,
gchar * value);
gboolean gst_tag_list_get_char_index (const GstTagList * list,
const gchar * tag,
guint index,
gchar * value);
gboolean gst_tag_list_get_uchar (const GstTagList * list,
const gchar * tag,
guchar * value);
gboolean gst_tag_list_get_uchar_index (const GstTagList * list,
const gchar * tag,
guint index,
guchar * value);
gboolean gst_tag_list_get_boolean (const GstTagList * list,
const gchar * tag,
gboolean * value);
gboolean gst_tag_list_get_boolean_index (const GstTagList * list,
const gchar * tag,
guint index,
gboolean * value);
gboolean gst_tag_list_get_int (const GstTagList * list,
const gchar * tag,
gint * value);
gboolean gst_tag_list_get_int_index (const GstTagList * list,
const gchar * tag,
guint index,
gint * value);
gboolean gst_tag_list_get_uint (const GstTagList * list,
const gchar * tag,
guint * value);
gboolean gst_tag_list_get_uint_index (const GstTagList * list,
const gchar * tag,
guint index,
guint * value);
gboolean gst_tag_list_get_long (const GstTagList * list,
const gchar * tag,
glong * value);
gboolean gst_tag_list_get_long_index (const GstTagList * list,
const gchar * tag,
guint index,
glong * value);
gboolean gst_tag_list_get_ulong (const GstTagList * list,
const gchar * tag,
gulong * value);
gboolean gst_tag_list_get_ulong_index (const GstTagList * list,
const gchar * tag,
guint index,
gulong * value);
gboolean gst_tag_list_get_int64 (const GstTagList * list,
const gchar * tag,
gint64 * value);
gboolean gst_tag_list_get_int64_index (const GstTagList * list,
const gchar * tag,
guint index,
gint64 * value);
gboolean gst_tag_list_get_uint64 (const GstTagList * list,
const gchar * tag,
guint64 * value);
gboolean gst_tag_list_get_uint64_index (const GstTagList * list,
const gchar * tag,
guint index,
guint64 * value);
gboolean gst_tag_list_get_float (const GstTagList * list,
const gchar * tag,
gfloat * value);
gboolean gst_tag_list_get_float_index (const GstTagList * list,
const gchar * tag,
guint index,
gfloat * value);
gboolean gst_tag_list_get_double (const GstTagList * list,
const gchar * tag,
gdouble * value);
gboolean gst_tag_list_get_double_index (const GstTagList * list,
const gchar * tag,
guint index,
gdouble * value);
gboolean gst_tag_list_get_string (const GstTagList * list,
const gchar * tag,
gchar ** value);
gboolean gst_tag_list_get_string_index (const GstTagList * list,
const gchar * tag,
guint index,
gchar ** value);
gboolean gst_tag_list_get_pointer (const GstTagList * list,
const gchar * tag,
gpointer * value);
gboolean gst_tag_list_get_pointer_index (const GstTagList * list,
const gchar * tag,
guint index,
gpointer * value);
/* tag events */
GstEvent *gst_event_new_tag (GstTagList * list);
GstTagList *gst_event_tag_get_list (GstEvent * tag_event);
GstEvent * gst_event_new_tag (GstTagList * list);
GstTagList * gst_event_tag_get_list (GstEvent * tag_event);
/* GStreamer core tags (need to be discussed) */
@ -206,4 +262,5 @@ GstTagList *gst_event_tag_get_list (GstEvent * tag_event);
#define GST_TAG_ALBUM_PEAK "replaygain-album-peak"
G_END_DECLS
#endif /* __GST_EVENT_H__ */

View file

@ -25,13 +25,15 @@
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_TAG_SETTER (gst_tag_setter_get_type ())
#define GST_TAG_SETTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TAG_SETTER, GstTagSetter))
#define GST_TAG_SETTER_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GST_TYPE_TAG_SETTER, GstTagSetter))
#define GST_IS_TAG_SETTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TAG_SETTER))
#define GST_TAG_SETTER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_TAG_SETTER, GstTagSetterIFace))
typedef struct _GstTagSetter GstTagSetter; /* Dummy typedef */
typedef struct _GstTagSetterIFace GstTagSetterIFace;
typedef struct _GstTagSetter GstTagSetter; /* Dummy typedef */
typedef struct _GstTagSetterIFace GstTagSetterIFace;
/* use an empty interface here to allow detection of elements using user-set
tags */
@ -44,29 +46,38 @@ struct _GstTagSetterIFace
/* virtual table */
};
GType
gst_tag_setter_get_type (void)
G_GNUC_CONST;
GType gst_tag_setter_get_type (void) G_GNUC_CONST;
void gst_tag_setter_merge (GstTagSetter * setter,
const GstTagList * list, GstTagMergeMode mode);
void gst_tag_setter_add (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_setter_merge (GstTagSetter * setter,
const GstTagList * list,
GstTagMergeMode mode);
void gst_tag_setter_add (GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_setter_add_values (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, ...);
void gst_tag_setter_add_values (GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
...);
void gst_tag_setter_add_valist (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_setter_add_valist (GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
void gst_tag_setter_add_valist_values (GstTagSetter * setter,
GstTagMergeMode mode, const gchar * tag, va_list var_args);
void gst_tag_setter_add_valist_values(GstTagSetter * setter,
GstTagMergeMode mode,
const gchar * tag,
va_list var_args);
G_CONST_RETURN GstTagList *gst_tag_setter_get_list (GstTagSetter * setter);
G_CONST_RETURN GstTagList *
gst_tag_setter_get_list (GstTagSetter * setter);
void gst_tag_setter_set_merge_mode (GstTagSetter * setter,
GstTagMergeMode mode);
GstTagMergeMode gst_tag_setter_get_merge_mode (GstTagSetter * setter);
void gst_tag_setter_set_merge_mode (GstTagSetter * setter,
GstTagMergeMode mode);
GstTagMergeMode gst_tag_setter_get_merge_mode (GstTagSetter * setter);
G_END_DECLS
#endif /* __GST_TAG_INTERFACE_H__ */

View file

@ -29,20 +29,20 @@
#include <gst/gstbin.h>
G_BEGIN_DECLS extern GPrivate *gst_thread_current;
G_BEGIN_DECLS
typedef enum
{
GST_THREAD_STATE_SPINNING = GST_BIN_FLAG_LAST,
extern GPrivate *gst_thread_current;
typedef enum {
GST_THREAD_STATE_SPINNING = GST_BIN_FLAG_LAST,
GST_THREAD_STATE_REAPING,
/* when iterating with mutex locked (special cases)
may only be set by thread itself */
GST_THREAD_MUTEX_LOCKED,
/* padding */
GST_THREAD_FLAG_LAST = GST_BIN_FLAG_LAST + 4
}
GstThreadState;
GST_THREAD_FLAG_LAST = GST_BIN_FLAG_LAST + 4
} GstThreadState;
#define GST_TYPE_THREAD (gst_thread_get_type())
#define GST_THREAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_THREAD,GstThread))
@ -51,38 +51,38 @@ GstThreadState;
#define GST_IS_THREAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_THREAD))
#define GST_THREAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_THREAD, GstThreadClass))
typedef struct _GstThread GstThread;
typedef struct _GstThreadClass GstThreadClass;
typedef struct _GstThread GstThread;
typedef struct _GstThreadClass GstThreadClass;
struct _GstThread
{
GstBin bin;
struct _GstThread {
GstBin bin;
GThread *thread_id; /* id of the thread, if any */
GThread *thread_id; /* id of the thread, if any */
GThreadPriority priority;
GMutex *lock; /* thread lock/condititon pairs */
GCond *cond; /* used to control the thread */
GMutex *lock; /* thread lock/condititon pairs */
GCond *cond; /* used to control the thread */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstThreadClass
{
struct _GstThreadClass {
GstBinClass parent_class;
/* signals */
void (*shutdown) (GstThread * thread);
void (*shutdown) (GstThread *thread);
gpointer _gst_reserved[GST_PADDING];
};
GType gst_thread_get_type (void);
GType gst_thread_get_type (void);
GstElement *gst_thread_new (const gchar * name);
GstElement* gst_thread_new (const gchar *name);
void gst_thread_set_priority (GstThread * thread, GThreadPriority priority);
GstThread *gst_thread_get_current (void);
void gst_thread_set_priority (GstThread *thread, GThreadPriority priority);
GstThread * gst_thread_get_current (void);
G_END_DECLS
#endif /* __GST_THREAD_H__ */

View file

@ -28,11 +28,12 @@
#include <glib.h>
G_BEGIN_DECLS typedef struct _GstTrace GstTrace;
typedef struct _GstTraceEntry GstTraceEntry;
G_BEGIN_DECLS
struct _GstTrace
{
typedef struct _GstTrace GstTrace;
typedef struct _GstTraceEntry GstTraceEntry;
struct _GstTrace {
/* where this trace is going */
gchar *filename;
int fd;
@ -43,8 +44,7 @@ struct _GstTrace
gint bufoffset;
};
struct _GstTraceEntry
{
struct _GstTraceEntry {
gint64 timestamp;
guint32 sequence;
guint32 data;
@ -53,53 +53,49 @@ struct _GstTraceEntry
GstTrace *gst_trace_new (gchar * filename, gint size);
void gst_trace_destroy (GstTrace * trace);
void gst_trace_flush (GstTrace * trace);
void gst_trace_text_flush (GstTrace * trace);
GstTrace* gst_trace_new (gchar *filename, gint size);
void gst_trace_destroy (GstTrace *trace);
void gst_trace_flush (GstTrace *trace);
void gst_trace_text_flush (GstTrace *trace);
#define gst_trace_get_size(trace) ((trace)->bufsize)
#define gst_trace_get_offset(trace) ((trace)->bufoffset)
#define gst_trace_get_remaining(trace) ((trace)->bufsize - (trace)->bufoffset)
void gst_trace_set_default (GstTrace * trace);
void gst_trace_set_default (GstTrace *trace);
void _gst_trace_add_entry (GstTrace * trace, guint32 seq,
guint32 data, gchar * msg);
void _gst_trace_add_entry (GstTrace *trace, guint32 seq,
guint32 data, gchar *msg);
void gst_trace_read_tsc (gint64 * dst);
void gst_trace_read_tsc (gint64 *dst);
typedef enum
{
GST_ALLOC_TRACE_LIVE = (1 << 0),
GST_ALLOC_TRACE_MEM_LIVE = (1 << 1)
}
GstAllocTraceFlags;
GST_ALLOC_TRACE_LIVE = (1 << 0),
GST_ALLOC_TRACE_MEM_LIVE = (1 << 1)
} GstAllocTraceFlags;
typedef struct _GstAllocTrace GstAllocTrace;
typedef struct _GstAllocTrace GstAllocTrace;
struct _GstAllocTrace
{
gchar *name;
gint flags;
struct _GstAllocTrace {
gchar *name;
gint flags;
gint live;
GSList *mem_live;
gint live;
GSList *mem_live;
};
gboolean gst_alloc_trace_available (void);
G_CONST_RETURN GList *gst_alloc_trace_list (void);
GstAllocTrace *_gst_alloc_trace_register (const gchar * name);
gboolean gst_alloc_trace_available (void);
G_CONST_RETURN GList* gst_alloc_trace_list (void);
GstAllocTrace* _gst_alloc_trace_register (const gchar *name);
int gst_alloc_trace_live_all (void);
void gst_alloc_trace_print_all (void);
void gst_alloc_trace_set_flags_all (GstAllocTraceFlags flags);
int gst_alloc_trace_live_all (void);
void gst_alloc_trace_print_all (void);
void gst_alloc_trace_set_flags_all (GstAllocTraceFlags flags);
GstAllocTrace *gst_alloc_trace_get (const gchar * name);
void gst_alloc_trace_print (const GstAllocTrace * trace);
void gst_alloc_trace_set_flags (GstAllocTrace * trace,
GstAllocTraceFlags flags);
GstAllocTrace* gst_alloc_trace_get (const gchar *name);
void gst_alloc_trace_print (const GstAllocTrace *trace);
void gst_alloc_trace_set_flags (GstAllocTrace *trace, GstAllocTraceFlags flags);
#ifndef GST_DISABLE_ALLOC_TRACE
@ -131,7 +127,6 @@ G_STMT_START { \
#ifndef GST_DISABLE_TRACE
extern gint _gst_trace_on;
#define gst_trace_add_entry(trace,seq,data,msg) \
if (_gst_trace_on) { \
_gst_trace_add_entry(trace,(guint32)seq,(guint32)data,msg); \
@ -173,4 +168,5 @@ extern gint _gst_trace_on;
#endif /* GST_DISABLE_TRACE */
G_END_DECLS
#endif /* __GST_TRACE_H__ */

View file

@ -23,31 +23,31 @@
#include <glib.h>
#include "gstmacros.h"
G_BEGIN_DECLS typedef struct _GstTrashStack GstTrashStack;
G_BEGIN_DECLS
typedef struct _GstTrashStack GstTrashStack;
typedef struct _GstTrashStackElement GstTrashStackElement;
struct _GstTrashStackElement
{
struct _GstTrashStackElement {
GstTrashStackElement *next;
};
typedef volatile gpointer gst_vgpointer; /* gtk-doc volatile workaround */
typedef volatile gulong gst_vgulong; /* gtk-doc volatile workaround */
typedef volatile gpointer gst_vgpointer;/* gtk-doc volatile workaround */
typedef volatile gulong gst_vgulong; /* gtk-doc volatile workaround */
struct _GstTrashStack
{
gst_vgpointer head;
gst_vgulong count; /* for the ABA problem */
GMutex *lock; /* lock for C fallback */
struct _GstTrashStack {
gst_vgpointer head;
gst_vgulong count; /* for the ABA problem */
GMutex *lock; /* lock for C fallback */
};
GST_INLINE_FUNC GstTrashStack *gst_trash_stack_new (void);
GST_INLINE_FUNC void gst_trash_stack_init (GstTrashStack * stack);
GST_INLINE_FUNC void gst_trash_stack_destroy (GstTrashStack * stack);
GST_INLINE_FUNC void gst_trash_stack_free (GstTrashStack * stack);
GST_INLINE_FUNC GstTrashStack* gst_trash_stack_new (void);
GST_INLINE_FUNC void gst_trash_stack_init (GstTrashStack *stack);
GST_INLINE_FUNC void gst_trash_stack_destroy (GstTrashStack *stack);
GST_INLINE_FUNC void gst_trash_stack_free (GstTrashStack *stack);
GST_INLINE_FUNC void gst_trash_stack_push (GstTrashStack * stack, gpointer mem);
GST_INLINE_FUNC gpointer gst_trash_stack_pop (GstTrashStack * stack);
GST_INLINE_FUNC void gst_trash_stack_push (GstTrashStack *stack, gpointer mem);
GST_INLINE_FUNC gpointer gst_trash_stack_pop (GstTrashStack *stack);
#if defined (GST_CAN_INLINE) || defined (__GST_TRASH_STACK_C__)
@ -63,29 +63,34 @@ GST_INLINE_FUNC gpointer gst_trash_stack_pop (GstTrashStack * stack);
* intel ia32 optimized lockfree implementations
*/
GST_INLINE_FUNC void
gst_trash_stack_init (GstTrashStack * stack)
gst_trash_stack_init (GstTrashStack *stack)
{
stack->head = NULL;
stack->count = 0;
}
GST_INLINE_FUNC void
gst_trash_stack_destroy (GstTrashStack * stack)
gst_trash_stack_destroy (GstTrashStack *stack)
{
}
GST_INLINE_FUNC void
gst_trash_stack_push (GstTrashStack * stack, gpointer mem)
gst_trash_stack_push (GstTrashStack *stack, gpointer mem)
{
__asm__ __volatile__ ("1: \n\t" " movl %2, (%1); \n\t" /* mem->next == stack->head */
SMP_LOCK "cmpxchg %1, %0; \n\t" /* if head unchanged, move mem into it */
" jnz 1b; \n" /* head changed, retry */
::"m" (*stack), "r" (mem), "a" (stack->head)
);
__asm__ __volatile__ (
"1: \n\t"
" movl %2, (%1); \n\t" /* mem->next == stack->head */
SMP_LOCK "cmpxchg %1, %0; \n\t" /* if head unchanged, move mem into it */
" jnz 1b; \n" /* head changed, retry */
:
: "m" (*stack),
"r" (mem),
"a" (stack->head)
);
}
GST_INLINE_FUNC gpointer
gst_trash_stack_pop (GstTrashStack * stack)
gst_trash_stack_pop (GstTrashStack *stack)
{
GstTrashStackElement *head;
@ -95,16 +100,23 @@ gst_trash_stack_pop (GstTrashStack * stack)
* into place. This is usually solved using a counter which makes it highly
* inlikely that we manage to grab the wrong head->next value.
*/
__asm__ __volatile__ (" testl %%eax, %%eax; \n\t" /* if (head == NULL) return */
" jz 20f; \n\t" "10: \n\t" " movl (%%eax), %%ebx; \n\t" /* take value pointed to by head (head->next) */
" movl %%edx, %%ecx; \n\t" /* take counter */
" incl %%ecx; \n\t" /* and increment */
SMP_LOCK "cmpxchg8b %1; \n\t" /* if eax:edx == *stack, move ebx:ecx to *stack,
__asm__ __volatile__ (
" testl %%eax, %%eax; \n\t" /* if (head == NULL) return */
" jz 20f; \n\t"
"10: \n\t"
" movl (%%eax), %%ebx; \n\t" /* take value pointed to by head (head->next) */
" movl %%edx, %%ecx; \n\t" /* take counter */
" incl %%ecx; \n\t" /* and increment */
SMP_LOCK "cmpxchg8b %1; \n\t" /* if eax:edx == *stack, move ebx:ecx to *stack,
* else *stack is moved into eax:edx again... */
" jnz 10b; \n\t" /* ... and we retry */
"20: \n":"=a" (head)
:"m" (*stack), "a" (stack->head), "d" (stack->count)
:"ecx", "ebx");
" jnz 10b; \n\t" /* ... and we retry */
"20: \n"
: "=a" (head)
: "m" (*stack),
"a" (stack->head),
"d" (stack->count)
: "ecx", "ebx"
);
return head;
}
@ -115,20 +127,20 @@ gst_trash_stack_pop (GstTrashStack * stack)
* generic implementation
*/
GST_INLINE_FUNC void
gst_trash_stack_init (GstTrashStack * stack)
gst_trash_stack_init (GstTrashStack *stack)
{
stack->head = NULL;
stack->lock = g_mutex_new ();
stack->lock = g_mutex_new();
}
GST_INLINE_FUNC void
gst_trash_stack_destroy (GstTrashStack * stack)
gst_trash_stack_destroy (GstTrashStack *stack)
{
g_mutex_free (stack->lock);
}
GST_INLINE_FUNC void
gst_trash_stack_push (GstTrashStack * stack, gpointer mem)
gst_trash_stack_push (GstTrashStack *stack, gpointer mem)
{
GstTrashStackElement *elem = (GstTrashStackElement *) mem;
@ -139,7 +151,7 @@ gst_trash_stack_push (GstTrashStack * stack, gpointer mem)
}
GST_INLINE_FUNC gpointer
gst_trash_stack_pop (GstTrashStack * stack)
gst_trash_stack_pop (GstTrashStack *stack)
{
GstTrashStackElement *head;
@ -157,7 +169,7 @@ gst_trash_stack_pop (GstTrashStack * stack)
/*
* common functions
*/
GST_INLINE_FUNC GstTrashStack *
GST_INLINE_FUNC GstTrashStack*
gst_trash_stack_new (void)
{
GstTrashStack *stack;
@ -169,13 +181,14 @@ gst_trash_stack_new (void)
}
GST_INLINE_FUNC void
gst_trash_stack_free (GstTrashStack * stack)
gst_trash_stack_free (GstTrashStack *stack)
{
gst_trash_stack_destroy (stack);
g_free (stack);
}
#endif /* defined (GST_CAN_INLINE) || defined (__GST_TRASH_STACK_C__) */
#endif /* defined (GST_CAN_INLINE) || defined (__GST_TRASH_STACK_C__)*/
G_END_DECLS
#endif /* __GST_TRASH_STACK_H__ */

View file

@ -30,91 +30,96 @@
#include <gst/gsttypes.h>
G_BEGIN_DECLS
#define GST_TYPE_TYPE_FIND_FACTORY (gst_type_find_factory_get_type())
#define GST_TYPE_FIND_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TYPE_FIND_FACTORY, GstTypeFindFactory))
#define GST_IS_TYPE_FIND_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TYPE_FIND_FACTORY))
#define GST_TYPE_FIND_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TYPE_FIND_FACTORY, GstTypeFindFactoryClass))
#define GST_IS_TYPE_FIND_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TYPE_FIND_FACTORY))
#define GST_TYPE_FIND_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_TYPE_FIND_FACTORY, GstTypeFindFactoryClass))
typedef struct _GstTypeFind GstTypeFind;
typedef struct _GstTypeFindFactory GstTypeFindFactory;
typedef struct _GstTypeFindFactoryClass GstTypeFindFactoryClass;
typedef void (*GstTypeFindFunction) (GstTypeFind * find, gpointer data);
typedef void (* GstTypeFindFunction) (GstTypeFind *find, gpointer data);
typedef enum
{
typedef enum {
GST_TYPE_FIND_MINIMUM = 1,
GST_TYPE_FIND_POSSIBLE = 50,
GST_TYPE_FIND_LIKELY = 80,
GST_TYPE_FIND_NEARLY_CERTAIN = 99,
GST_TYPE_FIND_MAXIMUM = 100,
}
GstTypeFindProbability;
} GstTypeFindProbability;
struct _GstTypeFind
{
struct _GstTypeFind {
/* private to the caller of the typefind function */
guint8 *(*peek) (gpointer data, gint64 offset, guint size);
void (*suggest) (gpointer data, guint probability, const GstCaps * caps);
guint8 * (* peek) (gpointer data,
gint64 offset,
guint size);
void (* suggest) (gpointer data,
guint probability,
const GstCaps * caps);
gpointer data;
gpointer data;
/* optional */
guint64 (*get_length) (gpointer data);
guint64 (* get_length) (gpointer data);
/* <private> */
gpointer _gst_reserved[GST_PADDING];
};
struct _GstTypeFindFactory
{
GstPluginFeature feature;
struct _GstTypeFindFactory {
GstPluginFeature feature;
/* <private> */
GstTypeFindFunction function;
gchar **extensions;
GstCaps *caps; /* FIXME: not yet saved in registry */
GstTypeFindFunction function;
gchar ** extensions;
GstCaps * caps; /* FIXME: not yet saved in registry */
gpointer user_data;
gpointer user_data;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstTypeFindFactoryClass
{
GstPluginFeatureClass parent;
struct _GstTypeFindFactoryClass {
GstPluginFeatureClass parent;
/* <private> */
gpointer _gst_reserved[GST_PADDING];
};
/* typefind function interface */
guint8 *gst_type_find_peek (GstTypeFind * find, gint64 offset, guint size);
void gst_type_find_suggest (GstTypeFind * find,
guint probability, const GstCaps * caps);
guint64 gst_type_find_get_length (GstTypeFind * find);
guint8 * gst_type_find_peek (GstTypeFind * find,
gint64 offset,
guint size);
void gst_type_find_suggest (GstTypeFind * find,
guint probability,
const GstCaps * caps);
guint64 gst_type_find_get_length (GstTypeFind * find);
/* registration interface */
gboolean gst_type_find_register (GstPlugin * plugin,
const gchar * name,
guint rank,
GstTypeFindFunction func,
gchar ** extensions, const GstCaps * possible_caps, gpointer data);
gboolean gst_type_find_register (GstPlugin * plugin,
const gchar * name,
guint rank,
GstTypeFindFunction func,
gchar ** extensions,
const GstCaps * possible_caps,
gpointer data);
/* typefinding interface */
GType gst_type_find_factory_get_type (void);
GType gst_type_find_factory_get_type (void);
GList *gst_type_find_factory_get_list (void);
GList * gst_type_find_factory_get_list (void);
gchar **gst_type_find_factory_get_extensions (const GstTypeFindFactory *
factory);
const GstCaps *gst_type_find_factory_get_caps (const GstTypeFindFactory *
factory);
void gst_type_find_factory_call_function (const GstTypeFindFactory * factory,
GstTypeFind * find);
gchar ** gst_type_find_factory_get_extensions (const GstTypeFindFactory *factory);
const GstCaps * gst_type_find_factory_get_caps (const GstTypeFindFactory *factory);
void gst_type_find_factory_call_function (const GstTypeFindFactory *factory,
GstTypeFind *find);
G_END_DECLS
#endif /* __GST_TYPE_FIND_H__ */

View file

@ -22,7 +22,9 @@
#include <glib.h>
G_BEGIN_DECLS typedef struct _GstObject GstObject;
G_BEGIN_DECLS
typedef struct _GstObject GstObject;
typedef struct _GstObjectClass GstObjectClass;
typedef struct _GstPad GstPad;
typedef struct _GstPadClass GstPadClass;
@ -36,31 +38,25 @@ typedef struct _GstScheduler GstScheduler;
typedef struct _GstSchedulerClass GstSchedulerClass;
typedef struct _GstEvent GstEvent;
typedef enum
{
GST_STATE_VOID_PENDING = 0,
GST_STATE_NULL = (1 << 0),
GST_STATE_READY = (1 << 1),
GST_STATE_PAUSED = (1 << 2),
GST_STATE_PLAYING = (1 << 3)
}
GstElementState;
typedef enum {
GST_STATE_VOID_PENDING = 0,
GST_STATE_NULL = (1 << 0),
GST_STATE_READY = (1 << 1),
GST_STATE_PAUSED = (1 << 2),
GST_STATE_PLAYING = (1 << 3)
} GstElementState;
typedef enum
{
GST_STATE_FAILURE = 0,
GST_STATE_SUCCESS = 1,
GST_STATE_ASYNC = 2
}
GstElementStateReturn;
typedef enum {
GST_STATE_FAILURE = 0,
GST_STATE_SUCCESS = 1,
GST_STATE_ASYNC = 2
} GstElementStateReturn;
typedef enum
{
typedef enum {
GST_RESULT_OK,
GST_RESULT_NOK,
GST_RESULT_NOT_IMPL
}
GstResult;
} GstResult;
#define GST_RANK_PRIMARY 256
#define GST_RANK_SECONDARY 128
@ -71,4 +67,5 @@ GstResult;
#define GST_PADDING_INIT { 0 }
G_END_DECLS
#endif /* __GST_TYPES_H__ */

View file

@ -28,13 +28,13 @@
#include <gst/gstelement.h>
#include <gst/gstpluginfeature.h>
G_BEGIN_DECLS typedef enum
{
G_BEGIN_DECLS
typedef enum {
GST_URI_UNKNOWN,
GST_URI_SINK,
GST_URI_SRC
}
GstURIType;
} GstURIType;
#define GST_URI_TYPE_IS_VALID(type) ((type) == GST_URI_SRC || (type) == GST_URI_SINK)
@ -48,27 +48,28 @@ GstURIType;
typedef struct _GstURIHandler GstURIHandler;
typedef struct _GstURIHandlerInterface GstURIHandlerInterface;
struct _GstURIHandlerInterface
{
GTypeInterface parent;
struct _GstURIHandlerInterface {
GTypeInterface parent;
/* signals */
void (*new_uri) (GstURIHandler * handler, const gchar * uri);
void (* new_uri) (GstURIHandler * handler,
const gchar * uri);
/* idea for the future ?
gboolean (* require_password) (GstURIHandler * handler,
gchar ** username,
gchar ** password);
gboolean (* require_password) (GstURIHandler * handler,
gchar ** username,
gchar ** password);
*/
/* vtable */
/* querying capabilities */
GstURIType (*get_type) (void);
gchar **(*get_protocols) (void);
GstURIType (* get_type) (void);
gchar ** (* get_protocols) (void);
/* using the interface */
G_CONST_RETURN gchar *(*get_uri) (GstURIHandler * handler);
gboolean (*set_uri) (GstURIHandler * handler, const gchar * uri);
G_CONST_RETURN gchar *(* get_uri) (GstURIHandler * handler);
gboolean (* set_uri) (GstURIHandler * handler,
const gchar * uri);
/* we might want to add functions here to query features, someone with gnome-vfs knowledge go ahead */
@ -77,23 +78,28 @@ struct _GstURIHandlerInterface
/* general URI functions */
gboolean gst_uri_protocol_is_valid (const gchar * protocol);
gboolean gst_uri_is_valid (const gchar * uri);
gchar *gst_uri_get_protocol (const gchar * uri);
gchar *gst_uri_get_location (const gchar * uri);
gchar *gst_uri_construct (const gchar * protocol, const gchar * location);
gboolean gst_uri_protocol_is_valid (const gchar * protocol);
gboolean gst_uri_is_valid (const gchar * uri);
gchar * gst_uri_get_protocol (const gchar * uri);
gchar * gst_uri_get_location (const gchar * uri);
gchar * gst_uri_construct (const gchar * protocol,
const gchar * location);
GstElement *gst_element_make_from_uri (const GstURIType type,
const gchar * uri, const gchar * elementname);
GstElement * gst_element_make_from_uri (const GstURIType type,
const gchar * uri,
const gchar * elementname);
/* accessing the interface */
GType gst_uri_handler_get_type (void);
GType gst_uri_handler_get_type (void);
guint gst_uri_handler_get_uri_type (GstURIHandler * handler);
gchar **gst_uri_handler_get_protocols (GstURIHandler * handler);
G_CONST_RETURN gchar *gst_uri_handler_get_uri (GstURIHandler * handler);
gboolean gst_uri_handler_set_uri (GstURIHandler * handler, const gchar * uri);
void gst_uri_handler_new_uri (GstURIHandler * handler, const gchar * uri);
guint gst_uri_handler_get_uri_type (GstURIHandler * handler);
gchar ** gst_uri_handler_get_protocols (GstURIHandler * handler);
G_CONST_RETURN gchar * gst_uri_handler_get_uri (GstURIHandler * handler);
gboolean gst_uri_handler_set_uri (GstURIHandler * handler,
const gchar * uri);
void gst_uri_handler_new_uri (GstURIHandler * handler,
const gchar * uri);
G_END_DECLS
#endif /* __GST_URI_H__ */

View file

@ -27,9 +27,11 @@
#include <glib.h>
G_BEGIN_DECLS
/* a static type for making uri element properties */
#define GST_TYPE_URI (gst_uri_get_uri_type())
GType gst_uri_get_uri_type (void);
GType gst_uri_get_uri_type (void);
G_END_DECLS
#endif /* __GST_URI_TYPE_H */

View file

@ -28,15 +28,14 @@
#include <gst/gstelement.h>
G_BEGIN_DECLS
void gst_util_set_value_from_string (GValue * value,
const gchar * value_str);
void gst_util_set_object_arg (GObject * object, const gchar * name,
const gchar * value);
void gst_util_dump_mem (guchar * mem, guint size);
void gst_util_set_value_from_string (GValue *value, const gchar *value_str);
void gst_util_set_object_arg (GObject *object, const gchar *name, const gchar *value);
void gst_print_pad_caps (GString * buf, gint indent, GstPad * pad);
void gst_print_element_args (GString * buf, gint indent, GstElement * element);
void gst_util_dump_mem (guchar *mem, guint size);
void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad);
void gst_print_element_args (GString *buf, gint indent, GstElement *element);
/* Macros for defining classes. Ideas taken from Bonobo, which took theirs
@ -106,4 +105,5 @@ type_as_function ## _get_type (void) \
G_END_DECLS
#endif /* __GST_UTILS_H__ */

View file

@ -24,24 +24,24 @@
#include <gst/gstcaps.h>
G_BEGIN_DECLS
typedef int (*GstValueCompareFunc) (const GValue * value1,
const GValue * value2);
typedef char *(*GstValueSerializeFunc) (const GValue * value1);
typedef gboolean (*GstValueDeserializeFunc) (GValue * dest, const char *s);
typedef int (*GstValueUnionFunc) (GValue * dest, const GValue * value1,
const GValue * value2);
typedef int (*GstValueIntersectFunc) (GValue * dest, const GValue * value1,
const GValue * value2);
typedef int (* GstValueCompareFunc) (const GValue *value1,
const GValue *value2);
typedef char * (* GstValueSerializeFunc) (const GValue *value1);
typedef gboolean (* GstValueDeserializeFunc) (GValue *dest, const char *s);
typedef int (* GstValueUnionFunc) (GValue *dest, const GValue *value1,
const GValue *value2);
typedef int (* GstValueIntersectFunc) (GValue *dest, const GValue *value1,
const GValue *value2);
typedef struct _GstValueTable GstValueTable;
struct _GstValueTable
{
struct _GstValueTable {
GType type;
GstValueCompareFunc compare;
GstValueSerializeFunc serialize;
GstValueDeserializeFunc deserialize;
void *_gst_reserved[GST_PADDING];
void *_gst_reserved [GST_PADDING];
};
@ -78,66 +78,62 @@ extern GType gst_type_list;
/* list */
void gst_value_list_prepend_value (GValue * value,
const GValue * prepend_value);
void gst_value_list_append_value (GValue * value, const GValue * append_value);
guint gst_value_list_get_size (const GValue * value);
G_CONST_RETURN GValue *gst_value_list_get_value (const GValue * value,
guint index);
void gst_value_list_concat (GValue * dest, const GValue * value1,
const GValue * value2);
void gst_value_list_prepend_value (GValue *value, const GValue *prepend_value);
void gst_value_list_append_value (GValue *value, const GValue *append_value);
guint gst_value_list_get_size (const GValue *value);
G_CONST_RETURN GValue *gst_value_list_get_value (const GValue *value, guint index);
void gst_value_list_concat (GValue *dest, const GValue *value1, const GValue *value2);
/* fourcc */
void gst_value_set_fourcc (GValue * value, guint32 fourcc);
guint32 gst_value_get_fourcc (const GValue * value);
void gst_value_set_fourcc (GValue *value, guint32 fourcc);
guint32 gst_value_get_fourcc (const GValue *value);
/* int range */
void gst_value_set_int_range (GValue * value, int start, int end);
int gst_value_get_int_range_min (const GValue * value);
int gst_value_get_int_range_max (const GValue * value);
void gst_value_set_int_range (GValue *value, int start, int end);
int gst_value_get_int_range_min (const GValue *value);
int gst_value_get_int_range_max (const GValue *value);
/* double range */
void gst_value_set_double_range (GValue * value, double start, double end);
double gst_value_get_double_range_min (const GValue * value);
double gst_value_get_double_range_max (const GValue * value);
void gst_value_set_double_range (GValue *value, double start, double end);
double gst_value_get_double_range_min (const GValue *value);
double gst_value_get_double_range_max (const GValue *value);
/* caps */
G_CONST_RETURN GstCaps *gst_value_get_caps (const GValue * value);
void gst_value_set_caps (GValue * value, const GstCaps * caps);
G_CONST_RETURN GstCaps *gst_value_get_caps (const GValue *value);
void gst_value_set_caps (GValue *value, const GstCaps *caps);
/* compare */
gboolean gst_value_can_compare (const GValue * value1, const GValue * value2);
int gst_value_compare (const GValue * value1, const GValue * value2);
gboolean gst_value_can_compare (const GValue *value1, const GValue *value2);
int gst_value_compare (const GValue *value1, const GValue *value2);
/* union */
gboolean gst_value_can_union (const GValue * value1, const GValue * value2);
gboolean gst_value_union (GValue * dest, const GValue * value1,
const GValue * value2);
void gst_value_register_union_func (GType type1, GType type2,
GstValueUnionFunc func);
gboolean gst_value_can_union (const GValue *value1, const GValue *value2);
gboolean gst_value_union (GValue *dest, const GValue *value1, const GValue *value2);
void gst_value_register_union_func (GType type1, GType type2, GstValueUnionFunc func);
/* intersection */
gboolean gst_value_can_intersect (const GValue * value1, const GValue * value2);
gboolean gst_value_intersect (GValue * dest, const GValue * value1,
const GValue * value2);
void gst_value_register_intersect_func (GType type1, GType type2,
GstValueIntersectFunc func);
gboolean gst_value_can_intersect (const GValue *value1, const GValue *value2);
gboolean gst_value_intersect (GValue *dest, const GValue *value1, const GValue *value2);
void gst_value_register_intersect_func (GType type1, GType type2, GstValueIntersectFunc func);
/* */
void gst_value_register (const GstValueTable * table);
void gst_value_init_and_copy (GValue * dest, const GValue * src);
void gst_value_register (const GstValueTable *table);
void gst_value_init_and_copy (GValue *dest, const GValue *src);
void _gst_value_initialize (void);
gchar *gst_value_serialize (const GValue * value);
gboolean gst_value_deserialize (GValue * dest, const gchar * src);
gchar * gst_value_serialize (const GValue *value);
gboolean gst_value_deserialize (GValue *dest, const gchar *src);
G_END_DECLS
#endif

View file

@ -30,20 +30,22 @@
#include <gst/gstelement.h>
G_BEGIN_DECLS
#define GST_TYPE_XML (gst_xml_get_type ())
#define GST_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XML, GstXML))
#define GST_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XML))
#define GST_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_XML, GstXMLClass))
#define GST_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_XML))
#define GST_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_XML, GstXMLClass))
typedef struct _GstXML GstXML;
typedef struct _GstXMLClass GstXMLClass;
struct _GstXML
{
struct _GstXML {
GstObject object;
GList *topelements;
GList *topelements;
xmlNsPtr ns;
@ -52,41 +54,39 @@ struct _GstXML
typedef struct _GstXMLNs GstXMLNs;
struct _GstXMLClass
{
struct _GstXMLClass {
GstObjectClass parent_class;
/* signal callbacks */
void (*object_loaded) (GstXML * xml, GstObject * object, xmlNodePtr self);
void (*object_saved) (GstXML * xml, GstObject * object, xmlNodePtr self);
void (*object_loaded) (GstXML *xml, GstObject *object, xmlNodePtr self);
void (*object_saved) (GstXML *xml, GstObject *object, xmlNodePtr self);
gpointer _gst_reserved[GST_PADDING];
};
GType gst_xml_get_type (void);
GType gst_xml_get_type (void);
/* create an XML document out of a pipeline */
xmlDocPtr gst_xml_write (GstElement * element);
xmlDocPtr gst_xml_write (GstElement *element);
/* write a formatted representation of a pipeline to an open file */
gint gst_xml_write_file (GstElement * element, FILE * out);
gint gst_xml_write_file (GstElement *element, FILE *out);
GstXML *gst_xml_new (void);
GstXML* gst_xml_new (void);
gboolean gst_xml_parse_doc (GstXML * xml, xmlDocPtr doc, const guchar * root);
gboolean gst_xml_parse_file (GstXML * xml, const guchar * fname,
const guchar * root);
gboolean gst_xml_parse_memory (GstXML * xml, guchar * buffer, guint size,
const gchar * root);
gboolean gst_xml_parse_doc (GstXML *xml, xmlDocPtr doc, const guchar *root);
gboolean gst_xml_parse_file (GstXML *xml, const guchar *fname, const guchar *root);
gboolean gst_xml_parse_memory (GstXML *xml, guchar *buffer, guint size, const gchar *root);
GstElement *gst_xml_get_element (GstXML * xml, const guchar * name);
GList *gst_xml_get_topelements (GstXML * xml);
GstElement* gst_xml_get_element (GstXML *xml, const guchar *name);
GList* gst_xml_get_topelements (GstXML *xml);
GstElement *gst_xml_make_element (xmlNodePtr cur, GstObject * parent);
GstElement* gst_xml_make_element (xmlNodePtr cur, GstObject *parent);
G_END_DECLS
#else /* GST_DISABLE_LOADSAVE */
#pragma GCC poison gst_xml_write

View file

@ -8,8 +8,7 @@
# include "config.h"
#endif
typedef struct
{
typedef struct {
GstElement *src;
GstElement *sink;
gchar *src_name;
@ -17,23 +16,19 @@ typedef struct
GSList *src_pads;
GSList *sink_pads;
GstCaps *caps;
}
link_t;
} link_t;
typedef struct
{
typedef struct {
GSList *elements;
GstElement *first;
GstElement *last;
link_t *front;
link_t *back;
}
chain_t;
} chain_t;
typedef struct _graph_t graph_t;
struct _graph_t
{
chain_t *chain; /* links are supposed to be done now */
struct _graph_t {
chain_t *chain; /* links are supposed to be done now */
GSList *links;
GError **error;
};
@ -50,13 +45,12 @@ struct _graph_t
#endif
#ifdef __GST_PARSE_TRACE
gchar *__gst_parse_strdup (gchar * org);
void __gst_parse_strfree (gchar * str);
gchar *__gst_parse_strdup (gchar *org);
void __gst_parse_strfree (gchar *str);
link_t *__gst_parse_link_new ();
void __gst_parse_link_free (link_t * data);
void __gst_parse_link_free (link_t *data);
chain_t *__gst_parse_chain_new ();
void __gst_parse_chain_free (chain_t * data);
void __gst_parse_chain_free (chain_t *data);
# define gst_parse_strdup __gst_parse_strdup
# define gst_parse_strfree __gst_parse_strfree
# define gst_parse_link_new __gst_parse_link_new
@ -73,7 +67,7 @@ void __gst_parse_chain_free (chain_t * data);
#endif /* __GST_PARSE_TRACE */
static inline void
gst_parse_unescape (gchar * str)
gst_parse_unescape (gchar *str)
{
gchar *walk;

View file

@ -27,6 +27,7 @@
#include <gst/gstregistry.h>
G_BEGIN_DECLS
#define GST_TYPE_XML_REGISTRY \
(gst_xml_registry_get_type())
#define GST_XML_REGISTRY(obj) \
@ -37,11 +38,11 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XML_REGISTRY))
#define GST_IS_XML_REGISTRY_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XML_REGISTRY))
typedef struct _GstXMLRegistry GstXMLRegistry;
typedef struct _GstXMLRegistryClass GstXMLRegistryClass;
typedef enum
{
typedef enum {
GST_XML_REGISTRY_NONE,
GST_XML_REGISTRY_TOP,
GST_XML_REGISTRY_PATHS,
@ -53,79 +54,80 @@ typedef enum
GST_XML_REGISTRY_CAPS,
GST_XML_REGISTRY_STRUCTURE,
GST_XML_REGISTRY_PROPERTIES
}
GstXMLRegistryState;
} GstXMLRegistryState;
typedef enum
{
typedef enum {
GST_XML_REGISTRY_READ,
GST_XML_REGISTRY_WRITE
}
GstXMLRegistryMode;
} GstXMLRegistryMode;
typedef void (*GstXMLRegistryGetPerms) (GstXMLRegistry * registry);
typedef void (*GstXMLRegistryAddPathList) (GstXMLRegistry * registry);
typedef gboolean (*GstXMLRegistryParser) (GMarkupParseContext * context,
const gchar * tag,
const gchar * text,
gsize text_len, GstXMLRegistry * registry, GError ** error);
typedef void (*GstXMLRegistryGetPerms) (GstXMLRegistry *registry);
typedef void (*GstXMLRegistryAddPathList) (GstXMLRegistry *registry);
typedef gboolean (*GstXMLRegistryParser) (GMarkupParseContext *context,
const gchar *tag,
const gchar *text,
gsize text_len,
GstXMLRegistry *registry,
GError **error);
typedef gboolean (*GstXMLRegistryOpen) (GstXMLRegistry * registry,
GstXMLRegistryMode mode);
typedef gboolean (*GstXMLRegistryLoad) (GstXMLRegistry * registry,
gchar * dest, gssize * size);
typedef gboolean (*GstXMLRegistrySave) (GstXMLRegistry * registry,
gchar * format, ...);
typedef gboolean (*GstXMLRegistryClose) (GstXMLRegistry * registry);
typedef gboolean (*GstXMLRegistryOpen) (GstXMLRegistry *registry,
GstXMLRegistryMode mode);
typedef gboolean (*GstXMLRegistryLoad) (GstXMLRegistry *registry,
gchar *dest,
gssize *size);
typedef gboolean (*GstXMLRegistrySave) (GstXMLRegistry *registry,
gchar *format,
...);
typedef gboolean (*GstXMLRegistryClose) (GstXMLRegistry *registry);
struct _GstXMLRegistry
{
GstRegistry object;
struct _GstXMLRegistry {
GstRegistry object;
gchar *location;
gboolean open;
gchar *location;
gboolean open;
FILE *regfile;
gchar *buffer;
FILE *regfile;
gchar *buffer;
GMarkupParseContext *context;
GList *open_tags;
GstXMLRegistryState state;
GstXMLRegistryParser parser;
GMarkupParseContext *context;
GList *open_tags;
GstXMLRegistryState state;
GstXMLRegistryParser parser;
GstPlugin *current_plugin;
GstPluginFeature *current_feature;
GstPlugin *current_plugin;
GstPluginFeature *current_feature;
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps *caps;
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps *caps;
gchar *caps_name;
gchar *structure_name;
gchar *caps_name;
gchar *structure_name;
gboolean in_list;
GList *entry_list;
gchar *list_name;
gboolean in_list;
GList *entry_list;
gchar *list_name;
};
struct _GstXMLRegistryClass
{
GstRegistryClass parent_class;
struct _GstXMLRegistryClass {
GstRegistryClass parent_class;
GstXMLRegistryGetPerms get_perms_func;
GstXMLRegistryAddPathList add_path_list_func;
GstXMLRegistryOpen open_func;
GstXMLRegistryLoad load_func;
GstXMLRegistrySave save_func;
GstXMLRegistryClose close_func;
GstXMLRegistryOpen open_func;
GstXMLRegistryLoad load_func;
GstXMLRegistrySave save_func;
GstXMLRegistryClose close_func;
};
/* normal GObject stuff */
GType gst_xml_registry_get_type (void);
GType gst_xml_registry_get_type (void);
GstRegistry *gst_xml_registry_new (const gchar * name, const gchar * location);
GstRegistry* gst_xml_registry_new (const gchar *name, const gchar *location);
G_END_DECLS
#endif /* __GST_XML_REGISTRY_H__ */

View file

@ -83,126 +83,180 @@
by LL and unsigned long long values by ULL, lest
they be truncated by the compiler)
*/
typedef union
{
long long q; /* Quadword (64-bit) value */
unsigned long long uq; /* Unsigned Quadword */
int d[2]; /* 2 Doubleword (32-bit) values */
unsigned int ud[2]; /* 2 Unsigned Doubleword */
short w[4]; /* 4 Word (16-bit) values */
unsigned short uw[4]; /* 4 Unsigned Word */
char b[8]; /* 8 Byte (8-bit) values */
unsigned char ub[8]; /* 8 Unsigned Byte */
float s[2]; /* Single-precision (32-bit) value */
}
mmx_t;
typedef union {
long long q; /* Quadword (64-bit) value */
unsigned long long uq; /* Unsigned Quadword */
int d[2]; /* 2 Doubleword (32-bit) values */
unsigned int ud[2]; /* 2 Unsigned Doubleword */
short w[4]; /* 4 Word (16-bit) values */
unsigned short uw[4]; /* 4 Unsigned Word */
char b[8]; /* 8 Byte (8-bit) values */
unsigned char ub[8]; /* 8 Unsigned Byte */
float s[2]; /* Single-precision (32-bit) value */
} mmx_t;
/* Function to test if multimedia instructions are supported...
*/
inline extern int
mm_support (void)
mm_support(void)
{
/* Returns 1 if MMX instructions are supported,
3 if Cyrix MMX and Extended MMX instructions are supported
5 if AMD MMX and 3DNow! instructions are supported
0 if hardware does not support any of these
*/
register int rval = 0;
/* Returns 1 if MMX instructions are supported,
3 if Cyrix MMX and Extended MMX instructions are supported
5 if AMD MMX and 3DNow! instructions are supported
0 if hardware does not support any of these
*/
register int rval = 0;
__asm__ __volatile__ (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
"pushf\n\t" "popl %%eax\n\t" "movl %%eax, %%ecx\n\t"
/* ... Toggle the ID bit in one copy and store */
/* to the EFLAGS reg */
"xorl $0x200000, %%eax\n\t" "push %%eax\n\t" "popf\n\t"
/* ... Get the (hopefully modified) EFLAGS */
"pushf\n\t" "popl %%eax\n\t"
/* ... Compare and test result */
"xorl %%eax, %%ecx\n\t" "testl $0x200000, %%ecx\n\t" "jz NotSupported1\n\t" /* Nothing supported */
/* Get standard CPUID information, and
go to a specific vendor section */
"movl $0, %%eax\n\t" "cpuid\n\t"
/* Check for Intel */
"cmpl $0x756e6547, %%ebx\n\t"
"jne TryAMD\n\t"
"cmpl $0x49656e69, %%edx\n\t"
"jne TryAMD\n\t"
"cmpl $0x6c65746e, %%ecx\n" "jne TryAMD\n\t" "jmp Intel\n\t"
/* Check for AMD */
"\nTryAMD:\n\t"
"cmpl $0x68747541, %%ebx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x69746e65, %%edx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x444d4163, %%ecx\n" "jne TryCyrix\n\t" "jmp AMD\n\t"
/* Check for Cyrix */
"\nTryCyrix:\n\t"
"cmpl $0x69727943, %%ebx\n\t"
"jne NotSupported2\n\t"
"cmpl $0x736e4978, %%edx\n\t"
"jne NotSupported3\n\t"
"cmpl $0x64616574, %%ecx\n\t" "jne NotSupported4\n\t"
/* Drop through to Cyrix... */
/* Cyrix Section */
/* See if extended CPUID is supported */
"movl $0x80000000, %%eax\n\t" "cpuid\n\t" "cmpl $0x80000000, %%eax\n\t" "jl MMXtest\n\t" /* Try standard CPUID instead */
/* Extended CPUID supported, so get extended features */
"movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%eax\n\t" /* Test for MMX */
"jz NotSupported5\n\t" /* MMX not supported */
"testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */
"jnz EMMXSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n" "EMMXSupported:\n\t" "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */
"jmp Return\n\t"
/* AMD Section */
"AMD:\n\t"
/* See if extended CPUID is supported */
"movl $0x80000000, %%eax\n\t" "cpuid\n\t" "cmpl $0x80000000, %%eax\n\t" "jl MMXtest\n\t" /* Try standard CPUID instead */
/* Extended CPUID supported, so get extended features */
"movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported6\n\t" /* MMX not supported */
"testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */
"jnz ThreeDNowSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n" "ThreeDNowSupported:\n\t" "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */
"jmp Return\n\t"
/* Intel Section */
"Intel:\n\t"
/* Check for MMX */
"MMXtest:\n\t" "movl $1, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported7\n\t" /* MMX Not supported */
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\t"
/* Nothing supported */
"\nNotSupported1:\n\t"
"#movl $101, %0:\n\n\t"
"\nNotSupported2:\n\t"
"#movl $102, %0:\n\n\t"
"\nNotSupported3:\n\t"
"#movl $103, %0:\n\n\t"
"\nNotSupported4:\n\t"
"#movl $104, %0:\n\n\t"
"\nNotSupported5:\n\t"
"#movl $105, %0:\n\n\t"
"\nNotSupported6:\n\t"
"#movl $106, %0:\n\n\t"
"\nNotSupported7:\n\t"
"#movl $107, %0:\n\n\t" "movl $0, %0:\n\n\t" "Return:\n\t":"=a" (rval)
: /* no input */
:"eax", "ebx", "ecx", "edx");
__asm__ __volatile__ (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
"pushf\n\t"
"popl %%eax\n\t"
"movl %%eax, %%ecx\n\t"
/* Return */
return (rval);
/* ... Toggle the ID bit in one copy and store */
/* to the EFLAGS reg */
"xorl $0x200000, %%eax\n\t"
"push %%eax\n\t"
"popf\n\t"
/* ... Get the (hopefully modified) EFLAGS */
"pushf\n\t"
"popl %%eax\n\t"
/* ... Compare and test result */
"xorl %%eax, %%ecx\n\t"
"testl $0x200000, %%ecx\n\t"
"jz NotSupported1\n\t" /* Nothing supported */
/* Get standard CPUID information, and
go to a specific vendor section */
"movl $0, %%eax\n\t"
"cpuid\n\t"
/* Check for Intel */
"cmpl $0x756e6547, %%ebx\n\t"
"jne TryAMD\n\t"
"cmpl $0x49656e69, %%edx\n\t"
"jne TryAMD\n\t"
"cmpl $0x6c65746e, %%ecx\n"
"jne TryAMD\n\t"
"jmp Intel\n\t"
/* Check for AMD */
"\nTryAMD:\n\t"
"cmpl $0x68747541, %%ebx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x69746e65, %%edx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x444d4163, %%ecx\n"
"jne TryCyrix\n\t"
"jmp AMD\n\t"
/* Check for Cyrix */
"\nTryCyrix:\n\t"
"cmpl $0x69727943, %%ebx\n\t"
"jne NotSupported2\n\t"
"cmpl $0x736e4978, %%edx\n\t"
"jne NotSupported3\n\t"
"cmpl $0x64616574, %%ecx\n\t"
"jne NotSupported4\n\t"
/* Drop through to Cyrix... */
/* Cyrix Section */
/* See if extended CPUID is supported */
"movl $0x80000000, %%eax\n\t"
"cpuid\n\t"
"cmpl $0x80000000, %%eax\n\t"
"jl MMXtest\n\t" /* Try standard CPUID instead */
/* Extended CPUID supported, so get extended features */
"movl $0x80000001, %%eax\n\t"
"cpuid\n\t"
"testl $0x00800000, %%eax\n\t" /* Test for MMX */
"jz NotSupported5\n\t" /* MMX not supported */
"testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */
"jnz EMMXSupported\n\t"
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n"
"EMMXSupported:\n\t"
"movl $3, %0:\n\n\t" /* EMMX and MMX Supported */
"jmp Return\n\t"
/* AMD Section */
"AMD:\n\t"
/* See if extended CPUID is supported */
"movl $0x80000000, %%eax\n\t"
"cpuid\n\t"
"cmpl $0x80000000, %%eax\n\t"
"jl MMXtest\n\t" /* Try standard CPUID instead */
/* Extended CPUID supported, so get extended features */
"movl $0x80000001, %%eax\n\t"
"cpuid\n\t"
"testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported6\n\t" /* MMX not supported */
"testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */
"jnz ThreeDNowSupported\n\t"
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n"
"ThreeDNowSupported:\n\t"
"movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */
"jmp Return\n\t"
/* Intel Section */
"Intel:\n\t"
/* Check for MMX */
"MMXtest:\n\t"
"movl $1, %%eax\n\t"
"cpuid\n\t"
"testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported7\n\t" /* MMX Not supported */
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\t"
/* Nothing supported */
"\nNotSupported1:\n\t"
"#movl $101, %0:\n\n\t"
"\nNotSupported2:\n\t"
"#movl $102, %0:\n\n\t"
"\nNotSupported3:\n\t"
"#movl $103, %0:\n\n\t"
"\nNotSupported4:\n\t"
"#movl $104, %0:\n\n\t"
"\nNotSupported5:\n\t"
"#movl $105, %0:\n\n\t"
"\nNotSupported6:\n\t"
"#movl $106, %0:\n\n\t"
"\nNotSupported7:\n\t"
"#movl $107, %0:\n\n\t"
"movl $0, %0:\n\n\t"
"Return:\n\t"
: "=a" (rval)
: /* no input */
: "eax", "ebx", "ecx", "edx"
);
/* Return */
return(rval);
}
/* Function to test if mmx instructions are supported...
*/
inline extern int
mmx_ok (void)
mmx_ok(void)
{
/* Returns 1 if MMX instructions are supported, 0 otherwise */
return (mm_support () & 0x1);
/* Returns 1 if MMX instructions are supported, 0 otherwise */
return ( mm_support() & 0x1 );
}
@ -668,3 +722,4 @@ mmx_ok (void)
#endif
#endif

View file

@ -43,132 +43,188 @@
by LL and unsigned long long values by ULL, lest
they be truncated by the compiler)
*/
typedef union
{
float sf[4]; /* Single-precision (32-bit) value */
}
__attribute__ ((aligned (16))) sse_t; /* On a 16 byte (128-bit) boundary */
typedef union {
float sf[4]; /* Single-precision (32-bit) value */
} __attribute__ ((aligned (16))) sse_t; /* On a 16 byte (128-bit) boundary */
#if 0
/* Function to test if multimedia instructions are supported...
*/
inline extern int
mm_support (void)
mm_support(void)
{
/* Returns 1 if MMX instructions are supported,
3 if Cyrix MMX and Extended MMX instructions are supported
5 if AMD MMX and 3DNow! instructions are supported
9 if MMX and SSE instructions are supported
0 if hardware does not support any of these
*/
register int rval = 0;
/* Returns 1 if MMX instructions are supported,
3 if Cyrix MMX and Extended MMX instructions are supported
5 if AMD MMX and 3DNow! instructions are supported
9 if MMX and SSE instructions are supported
0 if hardware does not support any of these
*/
register int rval = 0;
__asm__ __volatile__ (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
"pushf\n\t" "popl %%eax\n\t" "movl %%eax, %%ecx\n\t"
/* ... Toggle the ID bit in one copy and store */
/* to the EFLAGS reg */
"xorl $0x200000, %%eax\n\t" "push %%eax\n\t" "popf\n\t"
/* ... Get the (hopefully modified) EFLAGS */
"pushf\n\t" "popl %%eax\n\t"
/* ... Compare and test result */
"xorl %%eax, %%ecx\n\t" "testl $0x200000, %%ecx\n\t" "jz NotSupported1\n\t" /* CPUID not supported */
/* Get standard CPUID information, and
go to a specific vendor section */
"movl $0, %%eax\n\t" "cpuid\n\t"
/* Check for Intel */
"cmpl $0x756e6547, %%ebx\n\t"
"jne TryAMD\n\t"
"cmpl $0x49656e69, %%edx\n\t"
"jne TryAMD\n\t"
"cmpl $0x6c65746e, %%ecx\n" "jne TryAMD\n\t" "jmp Intel\n\t"
/* Check for AMD */
"\nTryAMD:\n\t"
"cmpl $0x68747541, %%ebx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x69746e65, %%edx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x444d4163, %%ecx\n" "jne TryCyrix\n\t" "jmp AMD\n\t"
/* Check for Cyrix */
"\nTryCyrix:\n\t"
"cmpl $0x69727943, %%ebx\n\t"
"jne NotSupported2\n\t"
"cmpl $0x736e4978, %%edx\n\t"
"jne NotSupported3\n\t"
"cmpl $0x64616574, %%ecx\n\t" "jne NotSupported4\n\t"
/* Drop through to Cyrix... */
/* Cyrix Section */
/* See if extended CPUID level 80000001 is supported */
/* The value of CPUID/80000001 for the 6x86MX is undefined
according to the Cyrix CPU Detection Guide (Preliminary
Rev. 1.01 table 1), so we'll check the value of eax for
CPUID/0 to see if standard CPUID level 2 is supported.
According to the table, the only CPU which supports level
2 is also the only one which supports extended CPUID levels.
*/
"cmpl $0x2, %%eax\n\t" "jne MMXtest\n\t" /* Use standard CPUID instead */
/* Extended CPUID supported (in theory), so get extended
features */
"movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%eax\n\t" /* Test for MMX */
"jz NotSupported5\n\t" /* MMX not supported */
"testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */
"jnz EMMXSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n" "EMMXSupported:\n\t" "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */
"jmp Return\n\t"
/* AMD Section */
"AMD:\n\t"
/* See if extended CPUID is supported */
"movl $0x80000000, %%eax\n\t" "cpuid\n\t" "cmpl $0x80000000, %%eax\n\t" "jl MMXtest\n\t" /* Use standard CPUID instead */
/* Extended CPUID supported, so get extended features */
"movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported6\n\t" /* MMX not supported */
"testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */
"jnz ThreeDNowSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n" "ThreeDNowSupported:\n\t" "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */
"jmp Return\n\t"
/* Intel Section */
"Intel:\n\t"
/* Check for SSE */
"SSEtest:\n\t" "movl $1, %%eax\n\t" "cpuid\n\t" "testl $0x02000000, %%edx\n\t" /* Test for SSE */
"jz MMXtest\n\t" /* SSE Not supported */
"movl $9, %0:\n\n\t" /* SSE Supported */
"jmp Return\n\t"
/* Check for MMX */
"MMXtest:\n\t" "movl $1, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported7\n\t" /* MMX Not supported */
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\t"
/* Nothing supported */
"\nNotSupported1:\n\t"
"#movl $101, %0:\n\n\t"
"\nNotSupported2:\n\t"
"#movl $102, %0:\n\n\t"
"\nNotSupported3:\n\t"
"#movl $103, %0:\n\n\t"
"\nNotSupported4:\n\t"
"#movl $104, %0:\n\n\t"
"\nNotSupported5:\n\t"
"#movl $105, %0:\n\n\t"
"\nNotSupported6:\n\t"
"#movl $106, %0:\n\n\t"
"\nNotSupported7:\n\t"
"#movl $107, %0:\n\n\t" "movl $0, %0:\n\n\t" "Return:\n\t":"=a" (rval)
: /* no input */
:"eax", "ebx", "ecx", "edx");
__asm__ __volatile__ (
/* See if CPUID instruction is supported ... */
/* ... Get copies of EFLAGS into eax and ecx */
"pushf\n\t"
"popl %%eax\n\t"
"movl %%eax, %%ecx\n\t"
/* Return */
return (rval);
/* ... Toggle the ID bit in one copy and store */
/* to the EFLAGS reg */
"xorl $0x200000, %%eax\n\t"
"push %%eax\n\t"
"popf\n\t"
/* ... Get the (hopefully modified) EFLAGS */
"pushf\n\t"
"popl %%eax\n\t"
/* ... Compare and test result */
"xorl %%eax, %%ecx\n\t"
"testl $0x200000, %%ecx\n\t"
"jz NotSupported1\n\t" /* CPUID not supported */
/* Get standard CPUID information, and
go to a specific vendor section */
"movl $0, %%eax\n\t"
"cpuid\n\t"
/* Check for Intel */
"cmpl $0x756e6547, %%ebx\n\t"
"jne TryAMD\n\t"
"cmpl $0x49656e69, %%edx\n\t"
"jne TryAMD\n\t"
"cmpl $0x6c65746e, %%ecx\n"
"jne TryAMD\n\t"
"jmp Intel\n\t"
/* Check for AMD */
"\nTryAMD:\n\t"
"cmpl $0x68747541, %%ebx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x69746e65, %%edx\n\t"
"jne TryCyrix\n\t"
"cmpl $0x444d4163, %%ecx\n"
"jne TryCyrix\n\t"
"jmp AMD\n\t"
/* Check for Cyrix */
"\nTryCyrix:\n\t"
"cmpl $0x69727943, %%ebx\n\t"
"jne NotSupported2\n\t"
"cmpl $0x736e4978, %%edx\n\t"
"jne NotSupported3\n\t"
"cmpl $0x64616574, %%ecx\n\t"
"jne NotSupported4\n\t"
/* Drop through to Cyrix... */
/* Cyrix Section */
/* See if extended CPUID level 80000001 is supported */
/* The value of CPUID/80000001 for the 6x86MX is undefined
according to the Cyrix CPU Detection Guide (Preliminary
Rev. 1.01 table 1), so we'll check the value of eax for
CPUID/0 to see if standard CPUID level 2 is supported.
According to the table, the only CPU which supports level
2 is also the only one which supports extended CPUID levels.
*/
"cmpl $0x2, %%eax\n\t"
"jne MMXtest\n\t" /* Use standard CPUID instead */
/* Extended CPUID supported (in theory), so get extended
features */
"movl $0x80000001, %%eax\n\t"
"cpuid\n\t"
"testl $0x00800000, %%eax\n\t" /* Test for MMX */
"jz NotSupported5\n\t" /* MMX not supported */
"testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */
"jnz EMMXSupported\n\t"
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n"
"EMMXSupported:\n\t"
"movl $3, %0:\n\n\t" /* EMMX and MMX Supported */
"jmp Return\n\t"
/* AMD Section */
"AMD:\n\t"
/* See if extended CPUID is supported */
"movl $0x80000000, %%eax\n\t"
"cpuid\n\t"
"cmpl $0x80000000, %%eax\n\t"
"jl MMXtest\n\t" /* Use standard CPUID instead */
/* Extended CPUID supported, so get extended features */
"movl $0x80000001, %%eax\n\t"
"cpuid\n\t"
"testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported6\n\t" /* MMX not supported */
"testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */
"jnz ThreeDNowSupported\n\t"
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\n"
"ThreeDNowSupported:\n\t"
"movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */
"jmp Return\n\t"
/* Intel Section */
"Intel:\n\t"
/* Check for SSE */
"SSEtest:\n\t"
"movl $1, %%eax\n\t"
"cpuid\n\t"
"testl $0x02000000, %%edx\n\t" /* Test for SSE */
"jz MMXtest\n\t" /* SSE Not supported */
"movl $9, %0:\n\n\t" /* SSE Supported */
"jmp Return\n\t"
/* Check for MMX */
"MMXtest:\n\t"
"movl $1, %%eax\n\t"
"cpuid\n\t"
"testl $0x00800000, %%edx\n\t" /* Test for MMX */
"jz NotSupported7\n\t" /* MMX Not supported */
"movl $1, %0:\n\n\t" /* MMX Supported */
"jmp Return\n\t"
/* Nothing supported */
"\nNotSupported1:\n\t"
"#movl $101, %0:\n\n\t"
"\nNotSupported2:\n\t"
"#movl $102, %0:\n\n\t"
"\nNotSupported3:\n\t"
"#movl $103, %0:\n\n\t"
"\nNotSupported4:\n\t"
"#movl $104, %0:\n\n\t"
"\nNotSupported5:\n\t"
"#movl $105, %0:\n\n\t"
"\nNotSupported6:\n\t"
"#movl $106, %0:\n\n\t"
"\nNotSupported7:\n\t"
"#movl $107, %0:\n\n\t"
"movl $0, %0:\n\n\t"
"Return:\n\t"
: "=a" (rval)
: /* no input */
: "eax", "ebx", "ecx", "edx"
);
/* Return */
return(rval);
}
/* Function to test if sse instructions are supported...
*/
inline extern int
sse_ok (void)
sse_ok(void)
{
/* Returns 1 if SSE instructions are supported, 0 otherwise */
return ((mm_support () & 0x8) >> 3);
/* Returns 1 if SSE instructions are supported, 0 otherwise */
return ( (mm_support() & 0x8) >> 3 );
}
#endif
@ -485,13 +541,13 @@ sse_ok (void)
/* MOVe MaSK from Packed Single-fp
*/
#ifdef SSE_TRACE
#define movmskps(xmmreg, reg) \
#define movmskps(xmmreg, reg) \
{ \
fprintf(stderr, "movmskps()\n"); \
__asm__ __volatile__ ("movmskps %" #xmmreg ", %" #reg) \
}
#else
#define movmskps(xmmreg, reg) \
#define movmskps(xmmreg, reg) \
__asm__ __volatile__ ("movmskps %" #xmmreg ", %" #reg)
#endif
@ -499,13 +555,13 @@ sse_ok (void)
/* Parallel MOVe MaSK from mmx reg to 32-bit reg
*/
#ifdef SSE_TRACE
#define pmovmskb(mmreg, reg) \
#define pmovmskb(mmreg, reg) \
{ \
fprintf(stderr, "movmskps()\n"); \
__asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg) \
}
#else
#define pmovmskb(mmreg, reg) \
#define pmovmskb(mmreg, reg) \
__asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg)
#endif
@ -828,7 +884,7 @@ sse_ok (void)
/* Fp and mmX ReSTORe state
*/
#ifdef SSE_TRACE
#define fxrstor(mem) \
#define fxrstor(mem) \
{ \
fprintf(stderr, "fxrstor()\n"); \
__asm__ __volatile__ ("fxrstor %0" \
@ -836,7 +892,7 @@ sse_ok (void)
: "X" (mem)) \
}
#else
#define fxrstor(mem) \
#define fxrstor(mem) \
__asm__ __volatile__ ("fxrstor %0" \
: /* nothing */ \
: "X" (mem))
@ -846,7 +902,7 @@ sse_ok (void)
/* Fp and mmX SAVE state
*/
#ifdef SSE_TRACE
#define fxsave(mem) \
#define fxsave(mem) \
{ \
fprintf(stderr, "fxsave()\n"); \
__asm__ __volatile__ ("fxsave %0" \
@ -854,7 +910,7 @@ sse_ok (void)
: "X" (mem)) \
}
#else
#define fxsave(mem) \
#define fxsave(mem) \
__asm__ __volatile__ ("fxsave %0" \
: /* nothing */ \
: "X" (mem))
@ -864,7 +920,7 @@ sse_ok (void)
/* STore streaMing simd eXtensions Control/Status Register
*/
#ifdef SSE_TRACE
#define stmxcsr(mem) \
#define stmxcsr(mem) \
{ \
fprintf(stderr, "stmxcsr()\n"); \
__asm__ __volatile__ ("stmxcsr %0" \
@ -872,7 +928,7 @@ sse_ok (void)
: "X" (mem)) \
}
#else
#define stmxcsr(mem) \
#define stmxcsr(mem) \
__asm__ __volatile__ ("stmxcsr %0" \
: /* nothing */ \
: "X" (mem))
@ -882,7 +938,7 @@ sse_ok (void)
/* LoaD streaMing simd eXtensions Control/Status Register
*/
#ifdef SSE_TRACE
#define ldmxcsr(mem) \
#define ldmxcsr(mem) \
{ \
fprintf(stderr, "ldmxcsr()\n"); \
__asm__ __volatile__ ("ldmxcsr %0" \
@ -890,7 +946,7 @@ sse_ok (void)
: "X" (mem)) \
}
#else
#define ldmxcsr(mem) \
#define ldmxcsr(mem) \
__asm__ __volatile__ ("ldmxcsr %0" \
: /* nothing */ \
: "X" (mem))
@ -901,13 +957,13 @@ sse_ok (void)
occuring after fence in source code.
*/
#ifdef SSE_TRACE
#define sfence() \
#define sfence() \
{ \
fprintf(stderr, "sfence()\n"); \
__asm__ __volatile__ ("sfence\n\t") \
}
#else
#define sfence() \
#define sfence() \
__asm__ __volatile__ ("sfence\n\t")
#endif
@ -920,17 +976,18 @@ sse_ok (void)
*/
#ifdef SSE_TRACE
#else
#define prefetch(mem, hint) \
#define prefetch(mem, hint) \
__asm__ __volatile__ ("prefetch" #hint " %0" \
: /* nothing */ \
: "X" (mem))
#define prefetcht0(mem) prefetch(mem, t0)
#define prefetcht1(mem) prefetch(mem, t1)
#define prefetcht2(mem) prefetch(mem, t2)
#define prefetchnta(mem) prefetch(mem, nta)
#define prefetcht0(mem) prefetch(mem, t0)
#define prefetcht1(mem) prefetch(mem, t1)
#define prefetcht2(mem) prefetch(mem, t2)
#define prefetchnta(mem) prefetch(mem, nta)
#endif
#endif

View file

@ -24,52 +24,51 @@
#include <gst/gstpad.h>
#include <gst/gstevent.h>
G_BEGIN_DECLS typedef struct _GstByteStream GstByteStream;
G_BEGIN_DECLS
struct _GstByteStream
{
GstPad *pad;
typedef struct _GstByteStream GstByteStream;
GstEvent *event;
struct _GstByteStream {
GstPad *pad;
GSList *buflist;
guint32 headbufavail;
guint32 listavail;
GstEvent *event;
GSList *buflist;
guint32 headbufavail;
guint32 listavail;
/* we keep state of assembled pieces */
guint8 *assembled;
guint32 assembled_len; /* only valid when assembled != NULL */
guint8 *assembled;
guint32 assembled_len; /* only valid when assembled != NULL */
/* this is needed for gst_bytestream_tell */
guint64 offset;
guint64 last_ts;
guint64 offset;
guint64 last_ts;
/* if we are in the seek state (waiting for DISCONT) */
gboolean in_seek;
gboolean in_seek;
gpointer _gst_reserved[GST_PADDING];
};
GstByteStream *gst_bytestream_new (GstPad * pad);
void gst_bytestream_destroy (GstByteStream * bs);
GstByteStream* gst_bytestream_new (GstPad *pad);
void gst_bytestream_destroy (GstByteStream *bs);
void gst_bytestream_reset (GstByteStream * bs);
guint32 gst_bytestream_read (GstByteStream * bs, GstBuffer ** buf, guint32 len);
guint64 gst_bytestream_tell (GstByteStream * bs);
guint64 gst_bytestream_length (GstByteStream * bs);
gboolean gst_bytestream_size_hint (GstByteStream * bs, guint32 size);
gboolean gst_bytestream_seek (GstByteStream * bs, gint64 offset,
GstSeekType type);
guint32 gst_bytestream_peek (GstByteStream * bs, GstBuffer ** buf, guint32 len);
guint32 gst_bytestream_peek_bytes (GstByteStream * bs, guint8 ** data,
guint32 len);
gboolean gst_bytestream_flush (GstByteStream * bs, guint32 len);
void gst_bytestream_flush_fast (GstByteStream * bs, guint32 len);
void gst_bytestream_get_status (GstByteStream * bs, guint32 * avail_out,
GstEvent ** event_out);
guint64 gst_bytestream_get_timestamp (GstByteStream * bs);
void gst_bytestream_reset (GstByteStream *bs);
guint32 gst_bytestream_read (GstByteStream *bs, GstBuffer** buf, guint32 len);
guint64 gst_bytestream_tell (GstByteStream *bs);
guint64 gst_bytestream_length (GstByteStream *bs);
gboolean gst_bytestream_size_hint (GstByteStream *bs, guint32 size);
gboolean gst_bytestream_seek (GstByteStream *bs, gint64 offset, GstSeekType type);
guint32 gst_bytestream_peek (GstByteStream *bs, GstBuffer** buf, guint32 len);
guint32 gst_bytestream_peek_bytes (GstByteStream *bs, guint8** data, guint32 len);
gboolean gst_bytestream_flush (GstByteStream *bs, guint32 len);
void gst_bytestream_flush_fast (GstByteStream *bs, guint32 len);
void gst_bytestream_get_status (GstByteStream *bs, guint32 *avail_out, GstEvent **event_out);
guint64 gst_bytestream_get_timestamp (GstByteStream *bs);
void gst_bytestream_print_status (GstByteStream * bs);
void gst_bytestream_print_status (GstByteStream *bs);
G_END_DECLS
#endif /* __GST_BYTESTREAM_H__ */

View file

@ -28,7 +28,10 @@
#include <gst/control/dplinearinterp.h>
#include <gst/control/unitconvert.h>
G_BEGIN_DECLS void gst_control_init (int *argc, char **argv[]);
G_BEGIN_DECLS
void gst_control_init (int *argc, char **argv[]);
G_END_DECLS
#endif /* __GST_CONTROL_H__ */

Some files were not shown because too many files have changed in this diff Show more