inlined and extended docs

Original commit message from CVS:
* docs/gst/tmpl/.cvsignore:
* docs/gst/tmpl/gstquery.sgml:
* docs/gst/tmpl/gstutils.sgml:
* gst/gstquery.c:
* gst/gstquery.h:
inlined and extended docs
This commit is contained in:
Stefan Kost 2005-08-29 21:41:02 +00:00
parent d7b4691c3b
commit ba327dcf92
6 changed files with 85 additions and 275 deletions

View file

@ -1,3 +1,12 @@
2005-08-30 Stefan Kost <ensonic@users.sf.net>
* docs/gst/tmpl/.cvsignore:
* docs/gst/tmpl/gstquery.sgml:
* docs/gst/tmpl/gstutils.sgml:
* gst/gstquery.c:
* gst/gstquery.h:
inlined and extended docs
2005-08-30 Stefan Kost <ensonic@users.sf.net> 2005-08-30 Stefan Kost <ensonic@users.sf.net>
* check/gst-libs/controller.c: (GST_START_TEST), * check/gst-libs/controller.c: (GST_START_TEST),

View file

@ -21,5 +21,6 @@ gstmessage.sgml
gstminiobject.sgml gstminiobject.sgml
gstprobe.sgml gstprobe.sgml
gstpushsrc.sgml gstpushsrc.sgml
gstquery.sgml
gsttask.sgml gsttask.sgml
gstxmlregistry.sgml gstxmlregistry.sgml

View file

@ -1,267 +0,0 @@
<!-- ##### SECTION Title ##### -->
GstQuery
<!-- ##### SECTION Short_Description ##### -->
Dynamically register new query types
<!-- ##### SECTION Long_Description ##### -->
<para>
GstQuery functions are used to register a new query types to the gstreamer core.
Query types can be used to perform queries on pads and elements.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GstPad, #GstElement
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstQuery ##### -->
<para>
</para>
@mini_object:
@type:
@structure:
<!-- ##### ENUM GstQueryType ##### -->
<para>
Standard predefined Query types
</para>
@GST_QUERY_NONE: invalid query type
@GST_QUERY_POSITION: current position in stream
@GST_QUERY_LATENCY: latency of stream
@GST_QUERY_JITTER: current jitter of stream
@GST_QUERY_RATE: current rate of the stream
@GST_QUERY_SEEKING:
@GST_QUERY_CONVERT:
@GST_QUERY_FORMATS:
<!-- ##### MACRO GST_QUERY_TYPE_RATE_DEN ##### -->
<para>
Rates are relative to this value
</para>
<!-- ##### STRUCT GstQueryTypeDefinition ##### -->
<para>
A Query Type definition
</para>
@value: the unique id of the Query type
@nick: a short nick
@description: a longer description of the query type
<!-- ##### FUNCTION gst_query_type_register ##### -->
<para>
</para>
@nick:
@description:
@Returns:
<!-- ##### FUNCTION gst_query_type_get_by_nick ##### -->
<para>
</para>
@nick:
@Returns:
<!-- ##### FUNCTION gst_query_types_contains ##### -->
<para>
</para>
@types:
@type:
@Returns:
<!-- ##### FUNCTION gst_query_type_get_details ##### -->
<para>
</para>
@type:
@Returns:
<!-- # Unused Parameters # -->
@Param1:
<!-- ##### MACRO gst_query_copy ##### -->
<para>
</para>
@msg:
<!-- ##### FUNCTION gst_query_get_structure ##### -->
<para>
</para>
@query:
@Returns:
<!-- ##### MACRO gst_query_make_writable ##### -->
<para>
</para>
@msg:
<!-- ##### FUNCTION gst_query_new_application ##### -->
<para>
</para>
@type:
@structure:
@Returns:
<!-- ##### FUNCTION gst_query_new_convert ##### -->
<para>
</para>
@src_fmt:
@value:
@dest_fmt:
@Returns:
<!-- ##### FUNCTION gst_query_new_position ##### -->
<para>
</para>
@format:
@Returns:
<!-- ##### FUNCTION gst_query_parse_convert ##### -->
<para>
</para>
@query:
@src_format:
@src_value:
@dest_format:
@dest_value:
<!-- ##### FUNCTION gst_query_parse_position ##### -->
<para>
</para>
@query:
@format:
@cur:
@end:
<!-- ##### FUNCTION gst_query_parse_seeking_query ##### -->
<para>
</para>
@query:
@format:
<!-- ##### FUNCTION gst_query_parse_seeking_response ##### -->
<para>
</para>
@query:
@format:
@seekable:
@segment_start:
@segment_end:
<!-- ##### MACRO gst_query_ref ##### -->
<para>
</para>
@msg:
<!-- ##### FUNCTION gst_query_set_convert ##### -->
<para>
</para>
@query:
@src_format:
@src_value:
@dest_format:
@dest_value:
<!-- ##### FUNCTION gst_query_set_formats ##### -->
<para>
</para>
@query:
@n_formats:
@Varargs:
<!-- ##### FUNCTION gst_query_set_position ##### -->
<para>
</para>
@query:
@format:
@cur:
@end:
<!-- ##### FUNCTION gst_query_set_seeking ##### -->
<para>
</para>
@query:
@format:
@seekable:
@segment_start:
@segment_end:
<!-- ##### FUNCTION gst_query_type_iterate_definitions ##### -->
<para>
</para>
@Returns:
<!-- ##### MACRO gst_query_unref ##### -->
<para>
</para>
@msg:

View file

@ -55,6 +55,8 @@ various utility functions
parent_type_as_macro: parent_type_as_macro:
@\ @\
parent_type_as_macro: parent_type_as_macro:
@\
parent_type_as_macro:
@\ @\
parent_type_as_macro: parent_type_as_macro:
@interface_type: @interface_type:
@ -89,6 +91,8 @@ various utility functions
interface_as_function: interface_as_function:
@\ @\
interface_as_function: interface_as_function:
@\
interface_as_function:
@\ @\
interface_as_function: interface_as_function:

View file

@ -20,7 +20,16 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
/**
* SECTION:gstquery
* @short_description: Dynamically register new query types and parse results
* @see_also: #GstPad, #GstElement
*
* GstQuery functions are used to register a new query types to the gstreamer core.
* Query types can be used to perform queries on pads and elements.
*
* Query answer can be parsed using gst_query_parse_xxx() helpers.
*/
#include <string.h> #include <string.h>
#include "gst_private.h" #include "gst_private.h"
@ -316,6 +325,15 @@ gst_query_new (GstQueryType type, GstStructure * structure)
return query; return query;
} }
/**
* gst_query_new_position:
* @format: the default #GstFormat for the new query
*
* Constructs a new query stream position query object. Use gst_query_unref()
* when done with it.
*
* Returns: A new #GstQuery
*/
GstQuery * GstQuery *
gst_query_new_position (GstFormat format) gst_query_new_position (GstFormat format)
{ {
@ -331,6 +349,15 @@ gst_query_new_position (GstFormat format)
return query; return query;
} }
/**
* gst_query_set_position:
* @query: the query to fill in
* @format: the requested #GstFormat
* @cur: the current position
* @end: the end position
*
* Answer a position query by setting the requested values.
*/
void void
gst_query_set_position (GstQuery * query, GstFormat format, gst_query_set_position (GstQuery * query, GstFormat format,
gint64 cur, gint64 end) gint64 cur, gint64 end)
@ -345,6 +372,16 @@ gst_query_set_position (GstQuery * query, GstFormat format,
"cur", G_TYPE_INT64, cur, "end", G_TYPE_INT64, end, NULL); "cur", G_TYPE_INT64, cur, "end", G_TYPE_INT64, end, NULL);
} }
/**
* gst_query_parse_position:
* @query: the query to fill in
* @format: the requested #GstFormat or NULL for the default (used when creating
* the query)
* @cur: the storage for the current position
* @end: the storage for the end position
*
* Parse a position query answer.
*/
void void
gst_query_parse_position (GstQuery * query, GstFormat * format, gst_query_parse_position (GstQuery * query, GstFormat * format,
gint64 * cur, gint64 * end) gint64 * cur, gint64 * end)

View file

@ -34,24 +34,49 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/**
* GstQueryType:
* @GST_QUERY_NONE: invalid query type
* @GST_QUERY_POSITION: current/end position in stream
* @GST_QUERY_LATENCY: latency of stream
* @GST_QUERY_JITTER: current jitter of stream
* @GST_QUERY_RATE: current rate of the stream
* @GST_QUERY_SEEKING: seeking start/stop positions
* @GST_QUERY_CONVERT: convert values
* @GST_QUERY_FORMATS: query supported formats for convert
*
* Standard predefined Query types
*/
typedef enum { typedef enum {
GST_QUERY_NONE = 0, GST_QUERY_NONE = 0,
GST_QUERY_POSITION, /* get current/end position */ GST_QUERY_POSITION,
GST_QUERY_LATENCY, /* get current latency */ GST_QUERY_LATENCY,
GST_QUERY_JITTER, /* not in draft-query, necessary? */ GST_QUERY_JITTER, /* not in draft-query, necessary? */
GST_QUERY_RATE, /* get current playback rate */ GST_QUERY_RATE,
GST_QUERY_SEEKING, /* get seeking start/stop positions */ GST_QUERY_SEEKING,
GST_QUERY_CONVERT, /* convert values */ GST_QUERY_CONVERT,
GST_QUERY_FORMATS /* query supported formats for convert */ GST_QUERY_FORMATS
} GstQueryType; } GstQueryType;
/* rate is relative to 1000000 */ /**
* GST_QUERY_TYPE_RATE_DEN:
*
* Rates are relative to this value
*/
#define GST_QUERY_TYPE_RATE_DEN G_GINT64_CONSTANT (1000000) #define GST_QUERY_TYPE_RATE_DEN G_GINT64_CONSTANT (1000000)
typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition; typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition;
typedef struct _GstQuery GstQuery; typedef struct _GstQuery GstQuery;
typedef struct _GstQueryClass GstQueryClass; typedef struct _GstQueryClass GstQueryClass;
/**
* GstQueryTypeDefinition:
* @value: the unique id of the Query type
* @nick: a short nick
* @description: a longer description of the query type
*
* A Query Type definition
*/
struct _GstQueryTypeDefinition struct _GstQueryTypeDefinition
{ {
GstQueryType value; GstQueryType value;
@ -101,6 +126,7 @@ gboolean gst_query_types_contains (const GstQueryType *types,
GstQueryType type); GstQueryType type);
/* query for query details */ /* query for query details */
G_CONST_RETURN GstQueryTypeDefinition* G_CONST_RETURN GstQueryTypeDefinition*
gst_query_type_get_details (GstQueryType type); gst_query_type_get_details (GstQueryType type);
GstIterator* gst_query_type_iterate_definitions (void); GstIterator* gst_query_type_iterate_definitions (void);